From: Andreas Schneider Date: Wed, 9 May 2018 16:05:01 +0000 (+0200) Subject: s3:passdb: Fix size of ascii_p16 X-Git-Tag: ldb-1.4.0~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=728297ca889b39ce2006778bf6a5bf1c3ce82d6d;p=thirdparty%2Fsamba.git s3:passdb: Fix size of ascii_p16 ../source3/passdb/pdb_smbpasswd.c: In function ‘mod_smbfilepwd_entry’: ../source3/passdb/pdb_smbpasswd.c:1015:7: error: ‘:LCT-’ directive output may be truncated writing 5 bytes into a region of size between 0 and 255 [-Werror=format-truncat ion=] "%s:LCT-%08X:", ^~~~~ ../source3/passdb/pdb_smbpasswd.c:1015:4: note: using the range [0, 4294967295] for directive argument "%s:LCT-%08X:", ^~~~~~~~~~~~~~ In file included from ../source3/include/includes.h:23, from ../source3/passdb/pdb_smbpasswd.c:23: ../lib/replace/../replace/replace.h:514:18: note: ‘snprintf’ output between 15 and 270 bytes into a destination of size 255 #define slprintf snprintf ../source3/passdb/pdb_smbpasswd.c:1013:3: note: in expansion of macro ‘slprintf’ slprintf(&ascii_p16[strlen(ascii_p16)], ^~~~~~~~ BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Signed-off-by: Andreas Schneider Reviewed-by: Guenther Deschner --- diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c index 8a3d48b9980..2615cbdd788 100644 --- a/source3/passdb/pdb_smbpasswd.c +++ b/source3/passdb/pdb_smbpasswd.c @@ -741,7 +741,7 @@ static bool mod_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con char linebuf[LINEBUF_SIZE + 1]; char readbuf[1024]; int c; - fstring ascii_p16; + char ascii_p16[FSTRING_LEN + 20]; fstring encode_bits; unsigned char *p = NULL; size_t linebuf_len = 0;