From 6dc5bd57af2f5cc6b8c953d2b223d3b012b2400b Mon Sep 17 00:00:00 2001
From: xiechengliang <xiechengliang1@huawei.com>
Date: Fri, 19 Nov 2021 18:34:10 +0800
Subject: [PATCH] busybox: fix CVE-2021-42373

backport from upstream:
https://git.busybox.net/busybox/commit/?id=4d4fc5ca5ee4faae5dc4237f801d9527a3fb20cc

Signed-off-by: xiechengliang <xiechengliang1@huawei.com>
---
 miscutils/man.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/miscutils/man.c b/miscutils/man.c
index 722f6641e..d319e8bba 100644
--- a/miscutils/man.c
+++ b/miscutils/man.c
@@ -324,7 +324,7 @@ int man_main(int argc UNUSED_PARAM, char **argv)
 
 	/* is 1st ARG a SECTION? */
 	sec_list = conf_sec_list;
-	if (is_section_name(conf_sec_list, *argv)) {
+	if (is_section_name(conf_sec_list, *argv) && argv[1]) {
 		/* yes */
 		sec_list = *argv++;
 	}
-- 
2.27.0

