fiche icon indicating copy to clipboard operation
fiche copied to clipboard

Bugfix: use after free

Open divyekapoor opened this issue 1 year ago • 0 comments

This was detected by cc:

cc main.c fiche.c -pthread -O2 -Wall -Wextra -Wpedantic -Wstrict-overflow -fno-strict-aliasing -std=gnu11 -g -O0 -o fiche fiche.c: In function 'handle_connection': fiche.c:619:13: warning: pointer 'c' used after 'free' [-Wuse-after-free] 619 | close(c->socket); | ^~~~~~~~~~~~~~~~ fiche.c:617:13: note: call to 'free' here 617 | free(c); | ^~~~~~~ paste:~/src/fiche$ ls

$ cc --version cc (Alpine 13.1.1_git20230708) 13.1.1 20230708 Copyright (C) 2023 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

divyekapoor avatar Jul 14 '23 08:07 divyekapoor