aboutsummaryrefslogtreecommitdiffstats
path: root/packet-http.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-02-24 01:17:45 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-02-24 01:17:45 +0000
commit507a699a690c43f856afd33034808fd8f5d5cc62 (patch)
tree30dda0434501559453567f847ec1c8508a2a7ef9 /packet-http.c
parente0caf515a34b24978a190867ae510ab753390ccf (diff)
Non-ASCII characters can't be part of the name in a MIME header; if we
see one, assume we're dealing with data, not a MIME header. Spaces are separators. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7185 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-http.c')
-rw-r--r--packet-http.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/packet-http.c b/packet-http.c
index e94568944e..62a92f8f29 100644
--- a/packet-http.c
+++ b/packet-http.c
@@ -6,7 +6,7 @@
* Copyright 2002, Tim Potter <tpot@samba.org>
* Copyright 1999, Andrew Tridgell <tridge@samba.org>
*
- * $Id: packet-http.c,v 1.60 2002/12/02 23:43:26 guy Exp $
+ * $Id: packet-http.c,v 1.61 2003/02/24 01:17:45 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -282,8 +282,26 @@ dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
linep = line;
while (linep < lineend) {
c = *linep++;
+
+ /*
+ * This must be a CHAR to be part of a token; that
+ * means it must be ASCII.
+ */
+ if (!isascii(c))
+ break; /* not ASCII, thus not a CHAR */
+
+ /*
+ * This mustn't be a CTL to be part of a token;
+ * that means it must be printable.
+ */
if (!isprint(c))
break; /* not printable, not a MIME header */
+
+ /*
+ * This mustn't be a SEP to be part of a token;
+ * a ':' ends the token, everything else is an
+ * indication that this isn't a header.
+ */
switch (c) {
case '(':
@@ -302,10 +320,14 @@ dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case '=':
case '{':
case '}':
+ case ' ':
/*
- * It's a tspecial, so it's not part of a
+ * It's a separator, so it's not part of a
* token, so it's not a field name for the
* beginning of a MIME header.
+ *
+ * (We don't have to check for HT; that's
+ * already been ruled out by "isprint()".)
*/
goto not_http;