We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-Werror=use-after-free
http.c
On ubuntu 23.04, I followed instructions to build from source at 2f901dd. This triggered -Werror=use-after-free.
$ make Making all in src/c make[1]: Entering directory '/.../urweb/src/c' /bin/bash ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../include/urweb -I./../../include/urweb -Wall -Wunused-parameter -Werror -Wno-format-security -Wno-deprecated-declarations -U_FORTIFY_SOURCE -g -O2 -MT http.lo -MD -MP -MF .deps/http.Tpo -c -o http.lo http.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../include/urweb -I./../../include/urweb -Wall -Wunused-parameter -Werror -Wno-format-security -Wno-deprecated-declarations -U_FORTIFY_SOURCE -g -O2 -MT http.lo -MD -MP -MF .deps/http.Tpo -c http.c -fPIC -DPIC -o .libs/http.o http.c: In function 'worker': http.c:192:32: error: pointer 'buf' may be used after 'realloc' [-Werror=use-after-free] 192 | s = new_buf + (s - buf); | ~~~^~~~~~ http.c:181:25: note: call to 'realloc' here 181 | new_buf = realloc(buf, new_buf_size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ http.c:191:38: error: pointer 'buf' may be used after 'realloc' [-Werror=use-after-free] 191 | body = new_buf + (body - buf); | ~~~~~~^~~~~~ http.c:181:25: note: call to 'realloc' here 181 | new_buf = realloc(buf, new_buf_size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[1]: *** [Makefile:536: http.lo] Error 1 make[1]: Leaving directory '/.../urweb/src/c' make: *** [Makefile:433: all-recursive] Error 1
$ gcc --version gcc (Ubuntu 12.3.0-1ubuntu1~23.04) 12.3.0
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
On ubuntu 23.04, I followed instructions to build from source at 2f901dd. This triggered
-Werror=use-after-free
.The text was updated successfully, but these errors were encountered: