From: wessels <> Date: Tue, 19 Nov 1996 01:21:33 +0000 (+0000) Subject: xstrncpy ABR fix X-Git-Tag: SQUID_3_0_PRE1~5449 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d431f1751241af2187f78f7cefcc44c6d54620b;p=thirdparty%2Fsquid.git xstrncpy ABR fix --- diff --git a/src/mime.cc b/src/mime.cc index c544e9bb63..a3b69e3e6f 100644 --- a/src/mime.cc +++ b/src/mime.cc @@ -1,5 +1,5 @@ /* - * $Id: mime.cc,v 1.21 1996/11/15 00:36:21 wessels Exp $ + * $Id: mime.cc,v 1.22 1996/11/18 18:21:33 wessels Exp $ * * DEBUG: section 25 MIME Parsing * AUTHOR: Harvest Derived @@ -131,9 +131,8 @@ mime_get_header(const char *mime, const char *name) continue; if (!isspace(p[namelen]) && p[namelen] != ':') continue; - xstrncpy(header, p, GET_HDR_SZ); + xstrncpy(header, p, strcspn(p, "\n\r")+1); debug(25, 5, "mime_get_header: checking '%s'\n", header); - header[strcspn(header, "\n\r")] = '\0'; q = header; q += namelen; if (*q == ':')