Fix some edge cases where bad string handling could occur.

Submitted by: ps
This commit is contained in:
Alfred Perlstein 2002-05-01 08:29:41 +00:00
parent ef1047305e
commit 59017610b2

View File

@ -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;
}
}