[PATCH xserver 2/8] dmx: Fix some snprintf warnings.

Emil Velikov emil.l.velikov at gmail.com
Fri Apr 6 10:05:57 UTC 2018


On 6 April 2018 at 09:44, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> On Thu, Apr 05, 2018 at 01:13:55PM -0400, Adam Jackson wrote:
>> snprintf doesn't terminate the string if it truncates, so things like
>> this are lurking crashers:
>
> it doesn't? which platforms is that on? Apparently windows, from a quick
> google but that's about it, right?
>
Indeed - quick search points to the following
https://stackoverflow.com/a/13067917

Dummy test with gcc 7.2.1 -Wall -Wextra -pedantic -std=c89/99/11 (yes,
c89 is missing the API) shows proper NULL terminated strings.

-Emil


More information about the xorg-devel mailing list