Fix use-after-free in path-to-filename function
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 8s
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 8s
This commit is contained in:
parent
abc61a5504
commit
7cc0d624be
1 changed files with 4 additions and 1 deletions
|
@ -77,7 +77,10 @@ char *c_simple_http_path_to_cache_filename(const char *path) {
|
|||
}
|
||||
|
||||
if (prev_idx == 0) {
|
||||
return stripped_path;
|
||||
// Prevent string from being free'd by moving it to another variable.
|
||||
char *temp = stripped_path;
|
||||
stripped_path = NULL;
|
||||
return temp;
|
||||
} else {
|
||||
return c_simple_http_combine_string_parts(parts);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue