1
0
mirror of https://github.com/gophernicus/gophernicus.git synced 2024-07-14 03:04:16 -04:00

Prevent possible leak of executable gophermap contents.

This commit is contained in:
Yargo 2019-03-04 23:40:54 +01:00 committed by GitHub
commit 9fbb55d278
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

6
menu.c
View File

@ -316,13 +316,15 @@ int gophermap(state *st, char *mapfile, int depth)
}
/* Try to execute or open the mapfile */
#ifdef HAVE_POPEN
if (exe & st->opt_exec) {
#ifdef HAVE_POPEN
setenv_cgi(st, mapfile);
if ((fp = popen(command, "r")) == NULL) return OK;
#else
return OK;
#endif
}
else
#endif
if ((fp = fopen(mapfile, "r")) == NULL) return OK;
/* Read lines one by one */