ensure SSDP reply headers are not partial matches

This commit is contained in:
Cameron Gutman 2019-01-05 12:24:46 -08:00
parent 86030db849
commit aaa0ed8c86
4 changed files with 9 additions and 9 deletions

View File

@ -102,10 +102,10 @@ parse_msearch_reply(const char * reply, int size,
if(b!=0) {
/* skip the colon and white spaces */
do { b++; } while(reply[b]==' ' && b<size);
if(0==strncasecmp(reply+a, "location", 8)) {
if(0==strncasecmp(reply+a, "location:", 9)) {
*location = reply+b;
*locationsize = i-b;
} else if(0==strncasecmp(reply+a, "st", 2)) {
} else if(0==strncasecmp(reply+a, "st:", 3)) {
*st = reply+b;
*stsize = i-b;
}

View File

@ -57,12 +57,12 @@ parseMSEARCHReply(const char * reply, int size,
}
putchar('\n');*/
do { b++; } while(reply[b]==' ');
if(0==strncasecmp(reply+a, "location", 8))
if(0==strncasecmp(reply+a, "location:", 9))
{
*location = reply+b;
*locationsize = i-b;
}
else if(0==strncasecmp(reply+a, "st", 2))
else if(0==strncasecmp(reply+a, "st:", 3))
{
*st = reply+b;
*stsize = i-b;

View File

@ -123,10 +123,10 @@ parse_msearch_reply(const char * reply, int size,
if(b!=0) {
/* skip the colon and white spaces */
do { b++; } while(reply[b]==' ' && b<i);
if(0==strncasecmp(reply+a, "location", 8)) {
if(0==strncasecmp(reply+a, "location:", 9)) {
*location = reply+b;
*locationsize = i-b;
} else if(0==strncasecmp(reply+a, "st", 2)) {
} else if(0==strncasecmp(reply+a, "st:", 3)) {
*st = reply+b;
*stsize = i-b;
}

View File

@ -418,17 +418,17 @@ parseMSEARCHReply(const char * reply, int size,
putchar('\n');*/
/* skip the colon and white spaces */
do { b++; } while(reply[b]==' ');
if(0==strncasecmp(reply+a, "location", 8))
if(0==strncasecmp(reply+a, "location:", 9))
{
*location = reply+b;
*locationsize = i-b;
}
else if(0==strncasecmp(reply+a, "st", 2))
else if(0==strncasecmp(reply+a, "st:", 3))
{
*st = reply+b;
*stsize = i-b;
}
else if(0==strncasecmp(reply+a, "usn", 3))
else if(0==strncasecmp(reply+a, "usn:", 4))
{
*usn = reply+b;
*usnsize = i-b;