From eb03b1a6dbf40c5c6bee2c7ad00da5f644c625e6 Mon Sep 17 00:00:00 2001 From: SHIRAKATA Kentaro Date: Mon, 20 Jun 2022 20:32:23 +0900 Subject: [PATCH] remove unnecessary condition on parseoptions() `opts` here is always non-null, otherwise it leads segv at earlier code. --- src/options.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/options.c b/src/options.c index d939b3dd4..223a578df 100644 --- a/src/options.c +++ b/src/options.c @@ -630,12 +630,10 @@ parseoptions( if (pfx_match && optresult == optn_err) { char pfxbuf[BUFSZ], *pfxp; - if (opts) { - Snprintf(pfxbuf, sizeof pfxbuf, "%s", opts); - if ((pfxp = strchr(pfxbuf, ':')) != 0) - *pfxp = '\0'; - config_error_add("bad option suffix variation '%s'", pfxbuf); - } + Snprintf(pfxbuf, sizeof pfxbuf, "%s", opts); + if ((pfxp = strchr(pfxbuf, ':')) != 0) + *pfxp = '\0'; + config_error_add("bad option suffix variation '%s'", pfxbuf); return FALSE; } if (got_match && optresult == optn_err)