From 45f81ef706cf96ff57c3ba6eb41ab60ab6303861 Mon Sep 17 00:00:00 2001 From: Qualys Security Advisory Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] 0087-pmap: Fix parsing error in config_read(). $ echo '[' > crash $ pmap -C crash $$ Segmentation fault (core dumped) Signed-off-by: Craig Small --- pmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmap.c b/pmap.c index 6c1abc42..6d33c2d5 100644 --- a/pmap.c +++ b/pmap.c @@ -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);