diff mbox

[OpenWrt-Devel] procd: check for empty parameters in askfirst

Message ID 1426693488-31083-1-git-send-email-zefir.kurtisi@neratec.com
State Accepted
Headers show

Commit Message

Zefir Kurtisi March 18, 2015, 3:44 p.m. UTC
Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
---
 utils/askfirst.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox

Patch

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]);