aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-05-12 15:09:41 -0700
committerGuy Harris <guy@alum.mit.edu>2015-05-12 22:10:13 +0000
commite16500e80f85641b28971498c3fc580eab800055 (patch)
tree330b85bbb288947dae18451eec5af9279e84db3f /epan
parent99ca42153b9ab122c93a5ffae4ed9ffc40665d12 (diff)
Fix check for NUL at the end of a string.
*seq[slength - 1] means *(seq[slength - 1]), where seq points to a "const gchar *", so it fetches the pointer at an offset of slength - 1 from the pointer to which seq points, and dereferences that pointer. What's wanted is (*seq)[slength - 1], i.e. fetch the pointer to which seq points, and fetch the byte at an offset of slength - 1 from the byte to which said pointer points. Change-Id: I7246f5e6093d035bad59be530893f3fc54dad97e Reviewed-on: https://code.wireshark.org/review/8441 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-giop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/dissectors/packet-giop.c b/epan/dissectors/packet-giop.c
index 4802a31077..068532120f 100644
--- a/epan/dissectors/packet-giop.c
+++ b/epan/dissectors/packet-giop.c
@@ -3342,7 +3342,7 @@ 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') {
+ if ((*seq)[slength-1] == '\0') {
slength--;
}
} else {