bd23261b | 30-Nov-2024 |
John Marino <dragonflybsd@marino.st> |
libstdc++: Fix unsigned wraparound in codecvt::do_length [PR105857]
When the max argument to std::codecvt<wchar_t, char, mbstate_t>::length is SIZE_MAX/4+1 or greater the multiplication with sizeof(
libstdc++: Fix unsigned wraparound in codecvt::do_length [PR105857]
When the max argument to std::codecvt<wchar_t, char, mbstate_t>::length is SIZE_MAX/4+1 or greater the multiplication with sizeof(wchar_t) will wrap to a small value, and the alloca call will have a buffer that's smaller than requested. The call to mbsnrtowcs then has a buffer that is smaller than the value passed as the buffer length. When libstdc++.so is built with -D_FORTIFY_SOURCE=3 the mismatched buffer and length will get detected and will abort inside Glibc.
When it doesn't abort, there's no buffer overflow because Glibc's mbsnrtowcs has the same len * sizeof(wchar_t) calculation to determine the size of the buffer in bytes, and that will wrap to the same small number as the alloca argument. So luckily Glibc agrees with the caller about the real size of the buffer, and won't overflow it.
Even when the max argument isn't large enough to wrap, it can still be much too large to safely pass to alloca, so we should limit that. We already have a loop that processes chunks so that we can handle null characters in the middle of the input. If we limit the alloca buffer to 4kB then we'll just loop each time that buffer is filled.
Reported-by: Jonathan Wakely (GNU GCC)
show more ...
|
b2ced873 | 11-Mar-2024 |
Aaron LI <aly@aaronly.me> |
contrib/less: Fix edit.c for building
edit.c: In function 'close_pipe': edit.c:307:14: error: 'SIGPIPE' undeclared (first use in this function); did you mean 'SI_TIMER'? if (sig != SIGPIPE || ch_
contrib/less: Fix edit.c for building
edit.c: In function 'close_pipe': edit.c:307:14: error: 'SIGPIPE' undeclared (first use in this function); did you mean 'SI_TIMER'? if (sig != SIGPIPE || ch_length() != NULL_POSITION) ^~~~~~~ SI_TIMER
show more ...
|
ed569bc2 | 28-Feb-2024 |
Aaron LI <aly@aaronly.me> |
vendor/awk: upgrade from 20220912 to 20240122
This version is described in "The Awk Programming Language", Second Edition, by Al Aho, Brian Kernighan, and Peter Weinberger (Addison-Wesley, 2024, ISB
vendor/awk: upgrade from 20220912 to 20240122
This version is described in "The Awk Programming Language", Second Edition, by Al Aho, Brian Kernighan, and Peter Weinberger (Addison-Wesley, 2024, ISBN-13 978-0138269722, ISBN-10 0138269726).
Features: - support UTF-8 input - support CSV (comma-separated values) input
Fixes: - see FIXES and FIXES.1e - see commit history at: https://github.com/onetrueawk/awk/commits/master
show more ...
|