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