couchbase: Fix dissect length of status!=0 values
When dissecting response values with a non-zero status, the length calculation was incorrectly using the entire bodylen and not the actual value_len. This is likely due to an error in adding support for flex_frame_extras, before which bodylen == valuelen. Change-Id: I1d622bea582abcfafc5e97881d94fd7a7db6c80a Reviewed-on: https://code.wireshark.org/review/37598 Reviewed-by: Ben Huddleston <ben.huddleston@couchbase.com> Reviewed-by: Jim Walker <jim@couchbase.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
This commit is contained in:
parent
07ece895ac
commit
360ae8b1c0
|
@ -2853,12 +2853,12 @@ dissect_couchbase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
|
|||
|
||||
dissect_value(tvb, pinfo, couchbase_tree, offset, value_len, path_len,
|
||||
opcode, request, datatype);
|
||||
} else if (bodylen) {
|
||||
proto_tree_add_item(couchbase_tree, hf_value, tvb, offset, bodylen,
|
||||
} else if (value_len) {
|
||||
proto_tree_add_item(couchbase_tree, hf_value, tvb, offset, value_len,
|
||||
ENC_ASCII | ENC_NA);
|
||||
if (status == PROTOCOL_BINARY_RESPONSE_NOT_MY_VBUCKET || is_xerror(datatype, status)) {
|
||||
tvbuff_t *json_tvb;
|
||||
json_tvb = tvb_new_subset_length_caplen(tvb, offset, bodylen, bodylen);
|
||||
json_tvb = tvb_new_subset_length_caplen(tvb, offset, value_len, value_len);
|
||||
call_dissector(json_handle, json_tvb, pinfo, couchbase_tree);
|
||||
|
||||
} else if (opcode == PROTOCOL_BINARY_CMD_SUBDOC_MULTI_LOOKUP) {
|
||||
|
|
Loading…
Reference in New Issue