From 1189e6222981c8389612570cf08db7b5d49056d4 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Tue, 8 Apr 2003 17:40:47 +0000 Subject: string stuff; ok pval@ --- usr.sbin/httpd/src/modules/standard/mod_mime.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/usr.sbin/httpd/src/modules/standard/mod_mime.c b/usr.sbin/httpd/src/modules/standard/mod_mime.c index 3a6b487be61..ace2c095529 100644 --- a/usr.sbin/httpd/src/modules/standard/mod_mime.c +++ b/usr.sbin/httpd/src/modules/standard/mod_mime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mod_mime.c,v 1.10 2002/08/15 16:06:11 henning Exp $ */ +/* $OpenBSD: mod_mime.c,v 1.11 2003/04/08 17:40:46 henning Exp $ */ /* ==================================================================== * The Apache Software License, Version 1.1 @@ -716,11 +716,12 @@ static int find_ct(request_rec *r) if (r->content_type) { content_type *ctp; char *ct; + size_t ctlen; int override = 0; - ct = (char *) ap_palloc(r->pool, - sizeof(char) * (strlen(r->content_type) + 1)); - strcpy(ct, r->content_type); + ctlen = sizeof(char) * (strlen(r->content_type) + 1); + ct = (char *) ap_palloc(r->pool, ctlen); + strlcpy(ct, r->content_type, ctlen); if ((ctp = analyze_ct(r->pool, ct))) { param *pp = ctp->param; -- cgit v1.2.3