From dfd3f7d9b9706ee8e0fdf81e0e4a4d7b7af138a1 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Tue, 11 Jun 2013 07:41:40 +0000 Subject: [PATCH] According to comment in 'magic_rsl_add' and to the way 'magic_rsl_printf' manages its buffer, I think that this memory should be apr_pstrdup'ed. This has been like that forever, but seems broken to me. Untested. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1491700 13f79535-47bb-0310-9956-ffa450edef68 --- modules/metadata/mod_mime_magic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/metadata/mod_mime_magic.c b/modules/metadata/mod_mime_magic.c index 03226aca5ed..80c585da9cb 100644 --- a/modules/metadata/mod_mime_magic.c +++ b/modules/metadata/mod_mime_magic.c @@ -606,7 +606,7 @@ static int magic_rsl_putchar(request_rec *r, char c) /* high overhead for 1 char - just hope they don't do this much */ str[0] = c; str[1] = '\0'; - return magic_rsl_add(r, str); + return magic_rsl_add(r, apr_pstrdup(r->pool, str)); } /* allocate and copy a contiguous string from a result string list */ -- 2.47.3