Re: [PATCH 03/14] Define SNPRINTF_SIZE_CORR=1 for Microsoft Visual C++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marius Storm-Olsen <mstormo@xxxxxxxxx> writes:

> From: Frank Li <lznuaa@xxxxxxxxx>
>
> The Microsoft C runtime's vsnprintf function does not add NUL at
> the end of the buffer.

This contradicts the way I read the comment in compat/snprintf.c from
f4626df (Add target architecture MinGW., 2007-12-01).

As far as I can see, the correction is about the meaning of the size
parameter to the function, namely, that a broken implementation may
mistakenly think that it was told the maximum length of the meat of the
string to write, and it is allowed to append a NUL beyond the limit, when
the caller actually is telling it the size of the buffer.

So if my reading is correct, it is not about "does not add NUL at the end"
at all; it is "adds NUL beyond the end of given output buffer."

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]