Fix some edge cases where bad string handling could occur.
Submitted by: ps
This commit is contained in:
parent
ef1047305e
commit
59017610b2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=95867
@ -115,6 +115,8 @@ mbufstrcmp(struct mbuf *m, struct mbuf *npkt, int offset, char *cmp)
|
||||
else if (*cmp != *(mtod(m, char *) + offset))
|
||||
return (0);
|
||||
}
|
||||
if (*cmp == '\0')
|
||||
return (1);
|
||||
offset = 0;
|
||||
}
|
||||
}
|
||||
@ -142,6 +144,8 @@ mbufstrncmp(struct mbuf *m, struct mbuf *npkt, int offset, int max, char *cmp)
|
||||
else if (*cmp != *(mtod(m, char *) + offset))
|
||||
return (0);
|
||||
}
|
||||
if (max == 0 || *cmp == '\0')
|
||||
return (1);
|
||||
offset = 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user