fix segmentation fault when an invalid HTTP Request is sent (Bug-ID: 2823020)

This commit is contained in:
Pete Hildebrandt 2011-01-21 20:35:11 +01:00
parent fba5fd6af4
commit 205d41a323
1 changed files with 2 additions and 1 deletions

View File

@ -75,7 +75,8 @@ void process(int out,char*v,struct usb_device *dev,int devnum)
memset( filename, 0, 1023);
strncpy( filename, strchr(v,' ')+1, strchr(v,'\n')-v );
ptr=strchr( filename, ' ' );
*ptr=0;
if (ptr != NULL)
*ptr = 0;
}
if(debug)
fprintf(stderr,"\nrequested filename(%s)\n",filename);