Bug 33530 - Truncated Content-Type string "Content-Type: ( with"
Summary: Truncated Content-Type string "Content-Type: ( with"
Status: RESOLVED DUPLICATE of bug 17497
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_mime_magic (show other bugs)
Version: 2.0.52
Hardware: Macintosh NetBSD
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-12 00:20 UTC by Makoto Fujiwara
Modified: 2005-02-25 08:16 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Makoto Fujiwara 2005-02-12 00:20:10 UTC
modules/metadata/mod_mime_magic.c has the following line.
   2016                 if (has_escapes)
   2017                     magic_rsl_puts(r, " (with escape sequences)");
   2018                 return 1;
But if this line is processed, the output will be
   Content-Encoding: (with 
Say, the string after embedded space is truncated.
If I put the hyphen(-) in place of spaces, say
   2017                     magic_rsl_puts(r, " (with-escape-sequences)");
server outputs entire string.
   Content-Encoding: (with-escape-sequences)

Some request_rec stored by following function may not be
processed correctly,
    542 static int magic_rsl_add(request_rec *r, char *str)
Comment 1 Makoto Fujiwara 2005-02-12 01:58:04 UTC
Reading following documentation tells me 
the value may not include 'white space'.

So the fix should be on the file
modules/metadata/mod_mime_magic.c, right ?


14.17 Content-Type
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

3.7 Media Types
http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7

Linear white space (LWS) MUST NOT be used between the type and
subtype, nor between an attribute and its value.
Comment 2 Joe Orton 2005-02-25 17:14:24 UTC
It's clearly wrong to generate a Content-Encoding like that.  What do you
propose, to fix this?  Just remove that magic_rsl_puts call completely?  Do you
have a file on which this path triggers?
Comment 3 Joe Orton 2005-02-25 17:16:52 UTC
Ah, this is actually a duplicate.

*** This bug has been marked as a duplicate of 17497 ***