fix unstrcpy
authorVolker Lendecke <vl@samba.org>
Tue, 22 Jul 2014 05:02:00 +0000 (07:02 +0200)
committerIra Cooper <ira@samba.org>
Fri, 1 Aug 2014 20:10:23 +0000 (22:10 +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

Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Fri Aug  1 22:10:23 CEST 2014 on sn-devel-104

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