From 59017610b27fb3ecb43a9fd2811c1c368723a8f4 Mon Sep 17 00:00:00 2001 From: Alfred Perlstein Date: Wed, 1 May 2002 08:29:41 +0000 Subject: [PATCH] Fix some edge cases where bad string handling could occur. Submitted by: ps --- sys/netinet/accf_http.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netinet/accf_http.c b/sys/netinet/accf_http.c index 042007825032..310917463776 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; } }