[cgi] set QUERY_STRING only if there is a query string

This commit is contained in:
Omar Polo 2020-11-06 18:02:41 +01:00
parent 120381c93d
commit f65ed01841
No known key found for this signature in database
GPG Key ID: 35F98C96A1786F0D
1 changed files with 2 additions and 1 deletions

3
gmid.c
View File

@ -417,7 +417,8 @@ start_cgi(const char *path, const char *query,
setenv("SERVER_PORT", "1965", 1);
setenv("PATH_INFO", path, 1);
setenv("PATH_TRANSLATED", expath, 1);
setenv("QUERY_STRING", query ? query : "", 1);
if (query != NULL)
setenv("QUERY_STRING", query, 1);
setenv("REMOTE_ADDR", addr, 1);
execvp(expath, argv);