Left-shift overflow in quotearg.c:151

2025-03-11 Thread Kirill Furman
Using gnulib and building it with UBSAN sanitizer I have found a bug in quotearg.c. Passing as char value, which modulus of 32 will be 31, const integer value will overflow. Here is PoC which causes this error: #include "config.h" #include "quotearg.h" int main(void) { struct quoting_options *o; u

Re: Left-shift overflow in quotearg.c:151

2025-03-10 Thread Bruno Haible via Gnulib discussion list
Hi, Kirill Furman wrote: > Using gnulib and building it with UBSAN sanitizer > I have found a bug in quotearg.c. Passing as char value, > which modulus of 32 will be 31, const integer value will overflow. > Here is PoC which causes this error: > ... > Here is the stacktrace: > UBSAN_OPTIONS=print_