[PATCH] Fix printf length calculation for hex/octal 64-bit values
obnox at samba.org
Thu Jun 2 22:12:03 UTC 2016
On 2016-06-02 at 15:03 -0700, Jeremy Allison wrote:
> 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:
> unique=17299420435556398153, written=7299420435556398153.
> 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 ?
LGTM - pushed
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: not available
More information about the samba-technical