Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 1/7] cleanups: Fix resource leak and buffer overrun in daemon.c

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:23

"Serge E. Hallyn" [off-list ref] writes:
Argh, I had to pull out a sheet of paper, but you are right.  I
misread, and the warning must be about the case where the
snprint "[%ld] " prints out 1023 characters.
If snprintf(buf, sizeof(buf), "[%ld] ", (long) getpid()) is
judged to possibly overrun the buffer by your static analysis
tool, I think the tool is broken.  It at least should know how
big a printed long can be.  It would earn bonus points if it can
warn me when sizeof(buf) is sufficiently small, say 40 bytes,
with a message like "on future architectures with 128-bit long
this code might break" ;-).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help