unsigned char promotes to int, which can overflow when shifted left by 24 bits or more. this has been reported multiple times but then forgotten. it's expected to be benign UB, but can trap when built with explicit overflow catching (ubsan or similar). fix it now. note that promotion to uint32_t is safe and portable even outside of the assumptions usually made in musl, since either uint32_t has rank at least unsigned int, so that no further default promotions happen, or int is wide enough that the shift can't overflow. this is a desirable property to have in case someone wants to reuse the code elsewhere. musl commit: 593caa456309714402ca4cb77c3770f4c24da9da Obtained from: musl |
||
---|---|---|
.. | ||
bcmp.3 | ||
bcmp.c | ||
bcopy.3 | ||
bcopy.c | ||
bstring.3 | ||
bzero.3 | ||
bzero.c | ||
ffs.3 | ||
ffs.c | ||
ffsl.c | ||
ffsll.c | ||
fls.c | ||
flsl.c | ||
flsll.c | ||
index.3 | ||
Makefile.inc | ||
memccpy.3 | ||
memccpy.c | ||
memchr.3 | ||
memchr.c | ||
memcmp.3 | ||
memcmp.c | ||
memcpy.3 | ||
memcpy.c | ||
memmem.3 | ||
memmem.c | ||
memmove.3 | ||
memmove.c | ||
memrchr.c | ||
memset_s.c | ||
memset.3 | ||
memset.c | ||
stpcpy.c | ||
stpncpy.c | ||
strcasecmp.3 | ||
strcasecmp.c | ||
strcasestr.c | ||
strcat.3 | ||
strcat.c | ||
strchr.3 | ||
strchr.c | ||
strchrnul.c | ||
strcmp.3 | ||
strcmp.c | ||
strcoll.3 | ||
strcoll.c | ||
strcpy.3 | ||
strcpy.c | ||
strcspn.c | ||
strdup.3 | ||
strdup.c | ||
strerror.3 | ||
strerror.c | ||
string.3 | ||
strlcat.c | ||
strlcpy.3 | ||
strlcpy.c | ||
strlen.3 | ||
strlen.c | ||
strmode.3 | ||
strmode.c | ||
strncat.c | ||
strncmp.c | ||
strncpy.c | ||
strndup.c | ||
strnlen.c | ||
strnstr.c | ||
strpbrk.3 | ||
strpbrk.c | ||
strrchr.c | ||
strsep.3 | ||
strsep.c | ||
strsignal.c | ||
strspn.3 | ||
strspn.c | ||
strstr.3 | ||
strstr.c | ||
strtok.3 | ||
strtok.c | ||
strxfrm.3 | ||
strxfrm.c | ||
swab.3 | ||
swab.c | ||
Symbol.map | ||
timingsafe_bcmp.3 | ||
timingsafe_bcmp.c | ||
timingsafe_memcmp.c | ||
wcpcpy.c | ||
wcpncpy.c | ||
wcscasecmp.c | ||
wcscat.c | ||
wcschr.c | ||
wcscmp.c | ||
wcscoll.3 | ||
wcscoll.c | ||
wcscpy.c | ||
wcscspn.c | ||
wcsdup.c | ||
wcslcat.c | ||
wcslcpy.c | ||
wcslen.c | ||
wcsncasecmp.c | ||
wcsncat.c | ||
wcsncmp.c | ||
wcsncpy.c | ||
wcsnlen.c | ||
wcspbrk.c | ||
wcsrchr.c | ||
wcsspn.c | ||
wcsstr.c | ||
wcstok.3 | ||
wcstok.c | ||
wcswidth.3 | ||
wcswidth.c | ||
wcsxfrm.3 | ||
wcsxfrm.c | ||
wmemchr.3 | ||
wmemchr.c | ||
wmemcmp.c | ||
wmemcpy.c | ||
wmemmove.c | ||
wmemset.c |