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>
This commit is contained in:
Guy Harris 2015-05-12 15:09:41 -07:00
parent 99ca42153b
commit e16500e80f
1 changed files with 1 additions and 1 deletions

View File

@ -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 {