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

double-free in http_read_cb() #174

Closed
snej opened this issue Aug 25, 2023 · 1 comment · Fixed by #181
Closed

double-free in http_read_cb() #174

snej opened this issue Aug 25, 2023 · 1 comment · Fixed by #181

Comments

@snej
Copy link
Contributor

snej commented Aug 25, 2023

The Clang static analyzer found a code path where a heap block is freed twice, in http_read_cb() in http.c

  1. On line 96, free(buf->base);
  2. On line 132, free(buf->base);

Unless I’m missing something, flow of control will go from line 96 to line 132 without returning or changing buf or buf->base in the interim.

ekoby added a commit that referenced this issue Sep 10, 2023
@ekoby
Copy link
Member

ekoby commented Sep 10, 2023

good catch, in practice double-free would happen if the server is not HTTP -- sends something that fails to parse by HTTP parser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants