The check_cgi_path() function would segfault if we ever support running
uhttpd without any CGI prefix.
Add a check to prevent running uh_patch_match() when the prefix is unset.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
}
pi->ip = NULL;
- return uh_path_match(conf.cgi_docroot_path, pi->phys);
+
+ if (conf.cgi_docroot_path)
+ return uh_path_match(conf.cgi_docroot_path, pi->phys);
+
+ return false;
}
struct dispatch_handler cgi_dispatch = {