[PATCH] Fix printf length calculation for hex/octal 64-bit values
jra at samba.org
Thu Jun 2 22:03:48 UTC 2016
From the bug report:
On AIX platform, I got different problems using smbd that seemed to be related with OpLocks
With some debugging, I could track it down to 'messaging_dgm_lockfile_create': the value written into file /var/run/sambalocks/msg.lock/PID is sometimes one digit shorter than the actual value of 'unique': the first digits get losts, eg:
With some more debugging, I found out that 'smbd' uses an own version of 'snprintf' that has a problem with large numbers; to be more precise buffer 'convert' in function 'fmtint' of 'lib/replace/snprintf.c' is too small; so the most signification digit gets lost.
I'm attaching a trivial patch to fix the problem (the length of buffer becomes to 22 to support octal values too).
Yours: Lorinczy Zsigmond
Reviewed-by: Jeremy Allison <jra at samba.org>
Can I get a second Team reviewer ?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1466 bytes
Desc: not available
More information about the samba-technical