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>
This commit is contained in:
Martin Mathieson 2020-06-14 11:48:27 +01:00 committed by Martin Mathieson
parent 326a43627a
commit d7f610d776
1 changed files with 1 additions and 1 deletions

View File

@ -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++;