From 6a82e95988dc7dd9e90b1f835fbc5cea7d2bdb5c Mon Sep 17 00:00:00 2001 From: Ales Ledvinka Date: Wed, 16 Jan 2013 12:17:06 +0000 Subject: [PATCH] 3600960 check the copy of password exists --- ipmitool/lib/ipmi_user.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ipmitool/lib/ipmi_user.c b/ipmitool/lib/ipmi_user.c index 1df9627..d7ab00b 100644 --- a/ipmitool/lib/ipmi_user.c +++ b/ipmitool/lib/ipmi_user.c @@ -723,7 +723,11 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv) else password = argv[3]; - if (strlen(password) > 20) + if (password == NULL) { + lprintf(LOG_ERR, "Unable to parse password argument."); + return -1; + } + else if (strlen(password) > 20) { lprintf(LOG_ERR, "Password is too long (> 20 bytes)"); return -1;