[OpenWrt-Devel] [PATCH] procd: check for empty parameters in askfirst
Zefir Kurtisi
zefir.kurtisi at neratec.com
Wed Mar 18 11:44:48 EDT 2015
Signed-off-by: Zefir Kurtisi <zefir.kurtisi at neratec.com>
---
utils/askfirst.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/utils/askfirst.c b/utils/askfirst.c
index e78823c..2aadd1a 100644
--- a/utils/askfirst.c
+++ b/utils/askfirst.c
@@ -31,6 +31,11 @@ int main(int argc, char **argv)
}
while (c != 0xA);
+ if (argc < 2) {
+ printf("Failure: %s without parameters\n", argv[0]);
+ return -1;
+ }
+
execvp(argv[1], &argv[1]);
printf("Failed to execute %s\n", argv[0]);
--
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list