s3:passdb: Fix size of ascii_p16
authorAndreas Schneider <asn@samba.org>
Wed, 9 May 2018 16:05:01 +0000 (18:05 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 20 Jun 2018 07:22:24 +0000 (09:22 +0200)
commitaa833e8b00cf5ce0b363328a20f42390e0ea63d1
treea16228191fbf7ba1653d709033fb3d5ea15e7d6b
parentaff126166a1539504e0d471b890f28d21f649648
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 <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 728297ca889b39ce2006778bf6a5bf1c3ce82d6d)
source3/passdb/pdb_smbpasswd.c