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

Spotted this while doing a review. When building with
- -Wformat-security, we get a warning:

../src/util/authtok.c: In function 'sss_authtok_set_string':
../src/util/authtok.c:104:5: error: format not a string literal and no
format arguments [-Werror=format-security]

This patch corrects it.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlD2pFwACgkQeiVVYja6o6ONdQCfUXVmagKVL5blE23eCI0BHM9G
XGIAoK9XwzMlaNxZYepac0XmO5SqPYil
=Uyfb
-----END PGP SIGNATURE-----
>From c6f6df57483ab42d4d30784595dc257435ed0e91 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <[email protected]>
Date: Wed, 16 Jan 2013 07:56:43 -0500
Subject: [PATCH] Correct format security for talloc_named of auth tokens

---
 src/util/authtok.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/authtok.c b/src/util/authtok.c
index 684b076220f79e426cec0139cddb9c93add6b482..1c54d04cceece494c2eb6fe2244f3d03d20ce017 100644
--- a/src/util/authtok.c
+++ b/src/util/authtok.c
@@ -101,7 +101,7 @@ static errno_t sss_authtok_set_string(TALLOC_CTX *mem_ctx,
 
     size = len + 1;
 
-    tok->data = talloc_named(mem_ctx, size, context_name);
+    tok->data = talloc_named(mem_ctx, size, "%s", context_name);
     if (!tok->data) {
         return ENOMEM;
     }
-- 
1.8.0.2

Attachment: 0001-Correct-format-security-for-talloc_named-of-auth-tok.patch.sig
Description: PGP signature

_______________________________________________
sssd-devel mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to