s3:passdb: Fix size of ascii_p16
commit99ab2e29bf2d3ddb88bd1ed1d8a04ed4da288f8b
authorAndreas Schneider <asn@samba.org>
Wed, 9 May 2018 16:05:01 +0000 (9 18:05 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 27 Jun 2018 08:34:21 +0000 (27 10:34 +0200)
tree6ba1ff66306400bd96b55577f4bb9e1230a7a589
parent992faaaffe6ed495cb88da5fe9669f82dbc59357
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