diff options
author | alfred <alfred@FreeBSD.org> | 2002-05-01 08:29:41 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2002-05-01 08:29:41 +0000 |
commit | 21257e117d533a15a7b84cd235b2b7773417143d (patch) | |
tree | fbe12ccb127ed2b2f650f7e33c29660ed994c6e1 /sys | |
parent | f34e021666b971c45ea81a8c4cc80c8a0c056466 (diff) | |
download | FreeBSD-src-21257e117d533a15a7b84cd235b2b7773417143d.zip FreeBSD-src-21257e117d533a15a7b84cd235b2b7773417143d.tar.gz |
Fix some edge cases where bad string handling could occur.
Submitted by: ps
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/accf_http.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/netinet/accf_http.c b/sys/netinet/accf_http.c index 0420078..3109174 100644 --- a/sys/netinet/accf_http.c +++ b/sys/netinet/accf_http.c @@ -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; } } |