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
The same code and the same build script worked in Ubuntu 20.04 and 22.04 as well as on Debian 10 - 12. Compiling on Ubuntu 24.04 gave an error:
gcc --version gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
make make all-recursive make[1]: Entering directory '/home/build/buildpack/glb-1.0.1' Making all in src make[2]: Entering directory '/home/build/buildpack/glb-1.0.1/src' gcc -DHAVE_CONFIG_H -I. -I.. -DNDEBUG -D_GNU_SOURCE -DUSE_EPOLL -Wdate-time -D_FORTIFY_SOURCE=3 -g -O3 -Wall -Werror -DGLBD -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/home/build/buildpack/glb-1.0.1=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/home/build/buildpack/glb-1.0.1=/usr/src/glb-1.0.1-3-noble -c -o glbd-glb_wdog.o test -f 'glb_wdog.c' || echo './'glb_wdog.c glb_wdog.c: In function 'wdog_copy_result': glb_wdog.c:335:21: error: pointer 'others_72' may be used after 'realloc' [-Werror=use-after-free] 335 | free (others); | ^~~~~~~~~~~~~ glb_wdog.c:332:36: note: call to 'realloc' here 332 | d->result.others = realloc (others, res->others_len); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[2]: *** [Makefile:720: glbd-glb_wdog.o] Error 1 make[2]: Leaving directory '/home/build/buildpack/glb-1.0.1/src' make[1]: *** [Makefile:413: all-recursive] Error 1 make[1]: Leaving directory '/home/build/buildpack/glb-1.0.1' make: *** [Makefile:345: all] Error 2
test -f 'glb_wdog.c' || echo './'
329 if (others_len < res->others_len || 330 others_len > (res->others_len * 2)) { 331 // buffer size is too different, reallocate 332 d->result.others = realloc (others, res->others_len); 333 if (!d->result.others && res->others_len > 0) { 334 // this is pretty much fatal, but we'll try 335 free (others); 336 d->result.others_len = 0; 337 } 338 else { 339 changed_length = true; 340 d->result.others_len = res->others_len; 341 } 342 }
Would be happy for a fix/hint. Thanks!
The text was updated successfully, but these errors were encountered:
Refs: #38
235b660
Use stack variable for realloc() return value. Fixes compilation with GCC 13.2.
Thanks Oli, that is fixed in the docker-build branch. Shall be merged ASAP.
Sorry, something went wrong.
32b357c
Use stack variable for realloc() return value. Fixes compilation with GCC 13.2. Bump patch version to 1.0.2
You are very welcome. Do you mind to increase the tag to 1.0.2 as well? :-)
Indeed! )
ayurchen
No branches or pull requests
The same code and the same build script worked in Ubuntu 20.04 and 22.04 as well as on Debian 10 - 12. Compiling on Ubuntu 24.04 gave an error:
gcc --version
gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
make
make all-recursive
make[1]: Entering directory '/home/build/buildpack/glb-1.0.1'
Making all in src
make[2]: Entering directory '/home/build/buildpack/glb-1.0.1/src'
gcc -DHAVE_CONFIG_H -I. -I.. -DNDEBUG -D_GNU_SOURCE -DUSE_EPOLL -Wdate-time -D_FORTIFY_SOURCE=3 -g -O3 -Wall -Werror -DGLBD -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/home/build/buildpack/glb-1.0.1=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/home/build/buildpack/glb-1.0.1=/usr/src/glb-1.0.1-3-noble -c -o glbd-glb_wdog.o
test -f 'glb_wdog.c' || echo './'
glb_wdog.cglb_wdog.c: In function 'wdog_copy_result':
glb_wdog.c:335:21: error: pointer 'others_72' may be used after 'realloc' [-Werror=use-after-free]
335 | free (others);
| ^~~~~~~~~~~~~
glb_wdog.c:332:36: note: call to 'realloc' here
332 | d->result.others = realloc (others, res->others_len);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:720: glbd-glb_wdog.o] Error 1
make[2]: Leaving directory '/home/build/buildpack/glb-1.0.1/src'
make[1]: *** [Makefile:413: all-recursive] Error 1
make[1]: Leaving directory '/home/build/buildpack/glb-1.0.1'
make: *** [Makefile:345: all] Error 2
329 if (others_len < res->others_len ||
330 others_len > (res->others_len * 2)) {
331 // buffer size is too different, reallocate
332 d->result.others = realloc (others, res->others_len);
333 if (!d->result.others && res->others_len > 0) {
334 // this is pretty much fatal, but we'll try
335 free (others);
336 d->result.others_len = 0;
337 }
338 else {
339 changed_length = true;
340 d->result.others_len = res->others_len;
341 }
342 }
Would be happy for a fix/hint. Thanks!
The text was updated successfully, but these errors were encountered: