[PATCH 4/5] commands: nv: fail if required var arguments are missing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Enrico Jorns <ejo@xxxxxxxxxxxxxx>
---
 commands/nv.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/commands/nv.c b/commands/nv.c
index d391f9e6b4..bb13ed1db0 100644
--- a/commands/nv.c
+++ b/commands/nv.c
@@ -56,6 +56,11 @@ static int do_nv(int argc, char *argv[])
 	argc -= optind;
 	argv += optind;
 
+	if (argc == 0) {
+		printf("Invalid usage: Missing argument");
+		return COMMAND_ERROR_USAGE;
+	}
+
 	for (i = 0; i < argc; i++) {
 		int ret;
 		value = strchr(argv[0], '=');
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux