diff options
author | Vasil Velichckov <vvvelichkov@gmail.com> | 2017-06-16 20:11:08 +0300 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-06-16 23:41:20 +0000 |
commit | 6f100a3df9bdd55aaf825fdbab86e46837ed1420 (patch) | |
tree | 260362c0282f62c23dfd770a9d8c1c43071631b1 /epan | |
parent | 8b99bb7fbf80f2fd3bfe53bbbfa14caec6319cbd (diff) | |
download | wireshark-6f100a3df9bdd55aaf825fdbab86e46837ed1420.tar.gz |
Fix JSON UTF-8 character validation and dissection
In abda30e9e validation of JSON UTF-8 characters was implemented but it
doesn't handle well the valid characters
Bug: 13806
Change-Id: Id8777065cfff9deae94f457dee08017d03b50f20
Reviewed-on: https://code.wireshark.org/review/22169
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-json.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/dissectors/packet-json.c b/epan/dissectors/packet-json.c index 5220e75850..c172a64a42 100644 --- a/epan/dissectors/packet-json.c +++ b/epan/dissectors/packet-json.c @@ -412,7 +412,7 @@ static char *json_string_unescape(tvbparse_elem_t *tok) str[j] = ch; /* XXX if it's not valid UTF-8 character, add some expert info? (it violates JSON grammar) */ - utf_len = json_tvb_memcpy_utf8(&str[j], tok->tvb, i, tok->len); + utf_len = json_tvb_memcpy_utf8(&str[j], tok->tvb, tok->offset + i, tok->offset + tok->len); j += utf_len; i += (utf_len - 1); } |