Skip to content
New issue

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

Bugfix: use after free #117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Commits on Jul 14, 2023

  1. Bugfix: use after free

    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 authored Jul 14, 2023
    Configuration menu
    Copy the full SHA
    6fb1a2d View commit details
    Browse the repository at this point in the history