aboutsummaryrefslogtreecommitdiffstats
path: root/rawshark.c
diff options
context:
space:
mode:
authorMartin Mathieson <martin.mathieson@keysight.com>2020-06-14 11:48:27 +0100
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2020-06-15 13:56:31 +0000
commitd7f610d7769a34d38df63c9e0f24eff3891cf492 (patch)
tree045d7ef5c848b230f2ccbc5e9bd9399edaae7231 /rawshark.c
parent326a43627a70d11371b3f99f3f59f44665065397 (diff)
rawshark: fix test to avoid reading beyond end of format string
rawshark.c:1347:21: note: opposite inner condition: pos>=len if (pos >= len) { /* There should always be a following character */ Change-Id: I2e1c6b3d031db4f658bb579e0c8aba8cac7c5cb5 Reviewed-on: https://code.wireshark.org/review/37475 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Diffstat (limited to 'rawshark.c')
-rw-r--r--rawshark.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rawshark.c b/rawshark.c
index 06cae3baf0..780b33a532 100644
--- a/rawshark.c
+++ b/rawshark.c
@@ -1344,7 +1344,7 @@ parse_field_string_format(gchar *format) {
while (pos < len) {
if (format[pos] == '%') {
- if (pos >= len) { /* There should always be a following character */
+ if (pos >= (len-1)) { /* There should always be a following specifier character */
return FALSE;
}
pos++;