1
0
mirror of https://github.com/git/git.git synced 2024-10-21 03:28:41 +02:00
git/compat
Jeff King 5096d4909f convert trivial sprintf / strcpy calls to xsnprintf
We sometimes sprintf into fixed-size buffers when we know
that the buffer is large enough to fit the input (either
because it's a constant, or because it's numeric input that
is bounded in size). Likewise with strcpy of constant
strings.

However, these sites make it hard to audit sprintf and
strcpy calls for buffer overflows, as a reader has to
cross-reference the size of the array with the input. Let's
use xsnprintf instead, which communicates to a reader that
we don't expect this to overflow (and catches the mistake in
case we do).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-09-25 10:18:18 -07:00
..
nedmalloc
poll poll: honor the timeout on Win32 2015-09-14 12:53:48 -07:00
regex
vcbuild
win32 Win32: Unicode file name support (dirent) 2014-07-15 11:19:09 -07:00
apple-common-crypto.h
basename.c
bswap.h compat/bswap.h: detect endianness from XL C compiler macros 2014-10-27 11:51:12 -07:00
fopen.c
gmtime.c
hstrerror.c
inet_ntop.c compat/inet_ntop: fix off-by-one in inet_ntop4 2015-09-25 10:18:18 -07:00
inet_pton.c
memmem.c
mingw.c convert trivial sprintf / strcpy calls to xsnprintf 2015-09-25 10:18:18 -07:00
mingw.h Merge branch 'nd/untracked-cache' 2015-05-26 13:24:46 -07:00
mkdir.c
mkdtemp.c
mmap.c
msvc.c
msvc.h
obstack.c
obstack.h
pread.c
precompose_utf8.c
precompose_utf8.h
qsort.c
setenv.c
snprintf.c
stat.c compat: convert modes to use portable file type values 2014-12-04 11:58:36 -08:00
strcasestr.c
strlcpy.c
strtoimax.c
strtoumax.c
terminal.c
terminal.h
unsetenv.c
win32.h
win32mmap.c
winansi.c convert trivial sprintf / strcpy calls to xsnprintf 2015-09-25 10:18:18 -07:00