Permalink
Browse files

httpd: made some sysinfo() calls more robust against malformed requests

  • Loading branch information...
RMerl committed Dec 4, 2018
1 parent 96524a6 commit 6f35e4f50586ee0689ec2e18eb3ec2a76d49420f
Showing with 2 additions and 2 deletions.
  1. +2 −2 release/src/router/httpd/sysinfo.c
@@ -384,7 +384,7 @@ int ej_show_sysinfo(int eid, webs_t wp, int argc, char_t ** argv)
char service[32];
sscanf(type, "pid.%31s", service);
if (strlen(service))
if (*service)
sprintf(result, "%d", pidof(service));
} else if(strncmp(type, "vpnip",5) == 0 ) {
@@ -418,7 +418,7 @@ int ej_show_sysinfo(int eid, webs_t wp, int argc, char_t ** argv)
sscanf(type,"vpnstatus.%9[^.].%d", service, &num);
if ((strlen(service)) && (num > 0) )
if ( (*service) && (num > 0) )
{
snprintf(buf, sizeof(buf), "vpn%s%d", service, num);
if (pidof(buf) > 0) {

0 comments on commit 6f35e4f

Please sign in to comment.