forked from osmocom/wireshark
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:
parent
99ca42153b
commit
e16500e80f
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue