diff options
author | cflip <cflip@cflip.net> | 2023-06-08 13:11:42 -0600 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2023-06-08 13:11:42 -0600 |
commit | eb7a9ca573c24f09d3cc2d3485af848c914aedac (patch) | |
tree | 6d753b75d453891fe07797d71b4db258ad4d1a39 /file.c | |
parent | c90a2f7a68e3d1054bceed8b67acb7bd0af8d14f (diff) |
Unset QUERY_STRING environment variable after running CGI script
This prevents an issue where the previous query string would persist on
requests without a query string.
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -112,6 +112,8 @@ int file_read_php(const char *filepath, const char *query_str, int sockfd) while ((bytes_read = fread(buffer, 1, FILE_READBUF_SIZE, fp)) > 0) write(sockfd, buffer, bytes_read); + unsetenv("QUERY_STRING"); + pclose(fp); return 0; } |