[PATCH 25/73] libselinux: Add printf format attribute annotation to

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


   This patch looks good to me. acked.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9x2BkACgkQrlYvE4MpobMligCdH3byLyRVFtfyVQOciXDDZ8ff
tdsAn23S6D/fcCFrQylZU6TKGLd/avGq
=cKbw
-----END PGP SIGNATURE-----
>From 82ab1e3df0f53cec0db22520ffc3bfd859dc760f Mon Sep 17 00:00:00 2001
From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Date: Mon, 23 Jan 2012 15:41:18 +0000
Subject: [PATCH 25/73] libselinux: Add printf format attribute annotation to
 die() method

Annotating the die method as taking printf format exposes
a bug in error reporting

Signed-off-by: Eric Paris <eparis@xxxxxxxxxx>
---
 libselinux/utils/avcstat.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libselinux/utils/avcstat.c b/libselinux/utils/avcstat.c
index 772118a..7239ef2 100644
--- a/libselinux/utils/avcstat.c
+++ b/libselinux/utils/avcstat.c
@@ -43,7 +43,7 @@ static char buf[DEF_BUF_SIZE];
 /* selinuxfs mount point */
 extern char *selinux_mnt;
 
-static void die(const char *msg, ...)
+static __attribute__((__format__(printf,1,2))) void die(const char *msg, ...)
 {
 	va_list args;
 
@@ -118,7 +118,7 @@ int main(int argc, char **argv)
 			exit(0);
 		default:
 			usage();
-			die("unrecognized parameter", i);
+			die("unrecognized parameter '%c'", i);
 		}
 	}
 
-- 
1.7.9.3


[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux