fix unstrcpy
authorVolker Lendecke <vl@samba.org>
Tue, 22 Jul 2014 05:02:00 +0000 (07:02 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 31 Jul 2014 13:13:44 +0000 (15:13 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10735
CVE-2014-3560: unstrcpy macro length is invalid

lib/util/string_wrappers.h

index 5f9d5684e62e54b526922e83299a8c41c3bfa692..243fafc27ef2a14b93199f58d6fb9a28db833e9d 100644 (file)
@@ -51,7 +51,7 @@ do { \
 #define unstrcpy(d,s) \
 do { \
        const char *_unstrcpy_src = (const char *)(s); \
-       strlcpy((d),_unstrcpy_src ? _unstrcpy_src : "",sizeof(fstring)); \
+       strlcpy((d),_unstrcpy_src ? _unstrcpy_src : "",sizeof(unstring)); \
 } while (0)
 
 #ifdef HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS