From 97d6a2e491c6ed08473beb2c4bac47c5cbc1201a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 20 Feb 2016 02:12:40 +0100 Subject: Imported Upstream version 1.8.16 --- lib/ipmi_firewall.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'lib/ipmi_firewall.c') diff --git a/lib/ipmi_firewall.c b/lib/ipmi_firewall.c index 8bda398..c3f51ad 100644 --- a/lib/ipmi_firewall.c +++ b/lib/ipmi_firewall.c @@ -512,7 +512,7 @@ _set_command_enables(struct ipmi_intf * intf, { struct ipmi_rs * rsp; struct ipmi_rq req; - unsigned char * d, rqdata[19]; + unsigned char rqdata[19]; unsigned int c; if (!p || !lnfn) { @@ -568,8 +568,6 @@ _set_command_enables(struct ipmi_intf * intf, return -1; } - d = rsp->data; - memset(&req, 0, sizeof(req)); req.msg.netfn = IPMI_NETFN_APP; req.msg.cmd = BMC_SET_COMMAND_ENABLES; @@ -591,7 +589,6 @@ _set_command_enables(struct ipmi_intf * intf, return -1; } - d = rsp->data; return 0; } @@ -1017,7 +1014,8 @@ ipmi_firewall_enable_disable(struct ipmi_intf * intf, int enable, int argc, char { struct ipmi_function_params p = {0xe, -1, -1, -1, -1}; struct bmc_fn_support * bmc_fn_support; - unsigned int l, n, c, ret; + int ret; + unsigned int l, n, c; unsigned char enables[MAX_COMMAND_BYTES]; if (argc < 1 || strncmp(argv[0], "help", 4) == 0) { @@ -1107,10 +1105,15 @@ ipmi_firewall_reset(struct ipmi_intf * intf, int argc, char ** argv) { struct ipmi_function_params p = {0xe, -1, -1, -1, -1}; struct bmc_fn_support * bmc_fn_support; - unsigned int l, n, c, ret; + int ret; + unsigned int l, n, c; unsigned char enables[MAX_COMMAND_BYTES]; - if (argc > 0 || (argc > 0 && strncmp(argv[0], "help", 4) == 0)) { + if (argc < 1) { + lprintf(LOG_ERR, "Not enough parameters given."); + printf_firewall_usage(); + return (-1); + } else if (argc > 0 && strncmp(argv[0], "help", 4) == 0) { printf_firewall_usage(); return 0; } -- cgit v1.2.3