From 4a9ae83d648447b109d705e04934d3426de01062 Mon Sep 17 00:00:00 2001 From: Celine Lee Date: Mon, 4 Apr 2022 17:57:24 -0400 Subject: [PATCH] Add length check on command line input --- BUSYBOX/chmod/vtchmod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUSYBOX/chmod/vtchmod.c b/BUSYBOX/chmod/vtchmod.c index ad10d0e8..67733d22 100644 --- a/BUSYBOX/chmod/vtchmod.c +++ b/BUSYBOX/chmod/vtchmod.c @@ -11,7 +11,7 @@ int main(int argc, char **argv) return 1; } - if (argv[1][0] == '-' && argv[1][1] == '6') + if (strlen(argv[1]) > 1 && argv[1][0] == '-' && argv[1][1] == '6') { struct utsname buf; if (0 == uname(&buf))