From f8cecaa71a88dc2d8a7f9f18213e23a175d73769 Mon Sep 17 00:00:00 2001 From: Zdenek Styblik Date: Tue, 13 Aug 2013 04:28:43 +0000 Subject: [PATCH] ID: 264 - incorrect array index in get_lan_param_select() Commit fixes incorrect array index in get_lan_param_select(). The param value matches the cmd in the lan_param struct, but it's not the same as the ipmi_lan_params[] array index. Here is an example of what I mean. This problem becomes apparent with the OEM extensions which use values 192+. Commit for Jeff Bastian --- ipmitool/lib/ipmi_lanp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipmitool/lib/ipmi_lanp.c b/ipmitool/lib/ipmi_lanp.c index 060cbf7..2f8072d 100644 --- a/ipmitool/lib/ipmi_lanp.c +++ b/ipmitool/lib/ipmi_lanp.c @@ -126,7 +126,7 @@ get_lan_param_select(struct ipmi_intf * intf, uint8_t chan, int param, int selec for (i = 0; ipmi_lan_params[i].cmd != (-1); i++) { if (ipmi_lan_params[i].cmd == param) { - p = &ipmi_lan_params[param]; + p = &ipmi_lan_params[i]; break; } }