1
0
mirror of https://github.com/git/git.git synced 2024-09-24 05:34:35 +02:00
git/compat
René Scharfe 7780af1e8e bswap: convert to unsigned before shifting in get_be32
The pointer p is dereferenced and we get an unsigned char.  Before
shifting it's automatically promoted to int.  Left-shifting a signed
32-bit value bigger than 127 by 24 places is undefined.  Explicitly
convert to a 32-bit unsigned type to avoid undefined behaviour if
the highest bit is set.

Found with Clang's UBSan.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-07-17 14:54:13 -07:00
..
nedmalloc compat: move strdup(3) replacement to its own file 2016-09-07 10:41:45 -07:00
poll
regex regex: fix a SIZE_MAX macro redefinition warning 2016-06-06 19:22:00 -07:00
vcbuild
win32 Merge branch 'jk/push-client-deadlock-fix' 2016-05-18 15:11:46 -07:00
apple-common-crypto.h
basename.c
bswap.h bswap: convert to unsigned before shifting in get_be32 2017-07-17 14:54:13 -07:00
fopen.c
gmtime.c
hstrerror.c
inet_ntop.c
inet_pton.c
memmem.c
mingw.c Merge branch 'js/no-html-bypass-on-windows' into maint 2016-09-08 21:35:55 -07:00
mingw.h mingw: intercept isatty() to handle /dev/null as Git expects it 2016-12-11 16:15:46 -08:00
mkdir.c
mkdtemp.c
mmap.c
msvc.c
msvc.h
obstack.c
obstack.h
pread.c
precompose_utf8.c
precompose_utf8.h
qsort_s.c compat: add qsort_s() 2017-01-23 11:02:34 -08:00
qsort.c
setenv.c
sha1-chunked.c
sha1-chunked.h
snprintf.c
stat.c
strcasestr.c
strdup.c compat: move strdup(3) replacement to its own file 2016-09-07 10:41:45 -07:00
strlcpy.c
strtoimax.c
strtoumax.c
terminal.c
terminal.h
unsetenv.c
win32.h
win32mmap.c
winansi.c Merge branch 'js/mingw-isatty' 2017-02-16 14:45:13 -08:00