Prevents truncation due to buffer size being too small.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11947
Signed-off-by: Lorinczy Zsigmond <lzsiga@freemail.c3.hu>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Jun 3 03:48:58 CEST 2016 on sn-devel-144
{
int signvalue = 0;
unsigned LLONG uvalue;
- char convert[20];
+ char convert[22+1]; /* 64-bit value in octal: 22 digits + \0 */
int place = 0;
int spadlen = 0; /* amount to space pad */
int zpadlen = 0; /* amount to zero pad */
(caps? "0123456789ABCDEF":"0123456789abcdef")
[uvalue % (unsigned)base ];
uvalue = (uvalue / (unsigned)base );
- } while(uvalue && (place < 20));
- if (place == 20) place--;
+ } while(uvalue && (place < sizeof(convert)));
+ if (place == sizeof(convert)) place--;
convert[place] = 0;
zpadlen = max - place;