aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-giop.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2015-05-10 16:45:29 -0400
committerAnders Broman <a.broman58@gmail.com>2015-05-11 04:28:24 +0000
commitf1e736772b90efc3cadbd8051f1153c88ad6ab7d (patch)
tree95db72e75c59bbbb7c5792380b3d181c7f3d0932 /epan/dissectors/packet-giop.c
parente997aaabe98f71cf9f8520ed34a909ee3720da9e (diff)
giop: ignore NULL-terminator in CDR strings
CDR strings appear to be both counted *and* NULL-terminated in many cases, which is rather weird, so if we see a NULL-terminator, ignore it in the count; otherwise we print a trailing '\000' on all the strings we put in the tree. Bug: 11126 Change-Id: I45b6b414683a6f646d37c2e2001b7319d5c80be5 Reviewed-on: https://code.wireshark.org/review/8390 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-giop.c')
-rw-r--r--epan/dissectors/packet-giop.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/epan/dissectors/packet-giop.c b/epan/dissectors/packet-giop.c
index ad8d970984..4802a31077 100644
--- a/epan/dissectors/packet-giop.c
+++ b/epan/dissectors/packet-giop.c
@@ -3342,6 +3342,9 @@ guint32 get_CDR_string(tvbuff_t *tvb, const gchar **seq, int *offset, gboolean s
}
else if (slength > 0) {
get_CDR_octet_seq(tvb, seq, offset, slength);
+ if (*seq[slength-1] == '\0') {
+ slength--;
+ }
} else {
*seq = wmem_strdup(wmem_packet_scope(), ""); /* zero-length string */
}