diff options
author | Anders Broman <anders.broman@ericsson.com> | 2012-06-11 07:09:11 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2012-06-11 07:09:11 +0000 |
commit | 34cb6f96d3bb52c0345d72b37c34ffd0da07a10e (patch) | |
tree | b49481d9c02c620b4e0aa4a9b93fd2840e6e260e | |
parent | 5cbccb3eadb2d6f86fea697c2d7eda389ab21cf7 (diff) | |
download | wireshark-34cb6f96d3bb52c0345d72b37c34ffd0da07a10e.tar.gz wireshark-34cb6f96d3bb52c0345d72b37c34ffd0da07a10e.tar.bz2 wireshark-34cb6f96d3bb52c0345d72b37c34ffd0da07a10e.zip |
From Michael Mann:
NUL terminate the decoded string.
Updated only dissector that uses epan_base64_decode() (packet-http.c) to assume
NULL termination.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7349
svn path=/trunk/; revision=43196
-rw-r--r-- | epan/base64.c | 1 | ||||
-rw-r--r-- | epan/base64.h | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-http.c | 1 |
3 files changed, 2 insertions, 2 deletions
diff --git a/epan/base64.c b/epan/base64.c index 949e995c0a..98153639ae 100644 --- a/epan/base64.c +++ b/epan/base64.c @@ -64,6 +64,7 @@ size_t epan_base64_decode(char *s) s++; } + s[i*3/4] = 0; return i*3/4; } diff --git a/epan/base64.h b/epan/base64.h index 8b18616efb..e19d39e4a6 100644 --- a/epan/base64.h +++ b/epan/base64.h @@ -30,7 +30,7 @@ extern "C" { #endif /* __cplusplus */ -/* In-place decoding of a base64 string. */ +/* In-place decoding of a base64 string. Resulting string is NULL terminated */ size_t epan_base64_decode(char *s); extern tvbuff_t* base64_to_tvb(tvbuff_t *parent, const char *base64); diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c index a627d6dcbf..10e5da4690 100644 --- a/epan/dissectors/packet-http.c +++ b/epan/dissectors/packet-http.c @@ -2432,7 +2432,6 @@ check_auth_basic(proto_item *hdr_item, tvbuff_t *tvb, gchar *value) value += hdrlen; len = epan_base64_decode(value); - value[len] = '\0'; proto_tree_add_string(hdr_tree, hf_http_basic, tvb, 0, 0, value); |