[Bug 11146] httpd_indexcgi.c not working
bugzilla at busybox.net
bugzilla at busybox.net
Fri Jul 13 16:33:54 UTC 2018
https://bugs.busybox.net/show_bug.cgi?id=11146
Denys Vlasenko <vda.linux at googlemail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |WORKSFORME
--- Comment #1 from Denys Vlasenko <vda.linux at googlemail.com> ---
(In reply to jc from comment #0)
>By changing line 239
> QUERY_STRING = getenv("QUERY_STRING");
>to
> QUERY_STRING = getenv("REQUEST_URI");
Er... line 239 "return 1"... and code already uses REQUEST_URI, since version
1.20.x:
...
215 int main(int argc, char *argv[])
216 {
217 dir_list_t *dir_list;
218 dir_list_t *cdir;
219 unsigned dir_list_count;
220 unsigned count_dirs;
221 unsigned count_files;
222 unsigned long long size_total;
223 int odd;
224 DIR *dirp;
225 char *location;
226
227 location = getenv("REQUEST_URI");
228 if (!location)
229 return 1;
230
231 /* drop URL arguments if any */
232 strchrnul(location, '?')[0] = '\0';
233
234 if (location[0] != '/'
235 || strstr(location, "//")
236 || strstr(location, "/../")
237 || strcmp(strrchr(location, '/'), "/..") == 0
238 ) {
239 return 1;
240 }
241
242 if (chdir("..")
243 || (location[1] && chdir(location + 1))
244 ) {
245 return 1;
246 }
247
248 dirp = opendir(".");
249 if (!dirp)
250 return 1;
251 dir_list = NULL;
252 dir_list_count = 0;
253 while (1) {
...
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the busybox-cvs
mailing list