0087-pmap: Fix parsing error in config_read().

$ echo '[' > crash
$ pmap -C crash $$
Segmentation fault (core dumped)

Signed-off-by: Craig Small <csmall@enc.com.au>
This commit is contained in:
Qualys Security Advisory 1970-01-01 00:00:00 +00:00 committed by Craig Small
parent bf409f92fd
commit 45f81ef706

2
pmap.c
View File

@ -836,7 +836,7 @@ static int config_read (char *rc_filename)
trimmed += SECTION_STR_MAPPING_LEN;
section_id = SECTION_ID_MAPPING;
} else {
while (*trimmed != ']' || *trimmed == '\0') trimmed++;
while (*trimmed != ']' && *trimmed != '\0') trimmed++;
if (*trimmed == ']') {
section_id = SECTION_ID_UNSUPPORTED;
xwarnx(_("unsupported section found in the config - line %d"), line_cnt);