Projects
Eulaceura:Factory
ipmitool
_service:obs_scm:ipmitool-CVE-2020-5208-Fix-buf...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:ipmitool-CVE-2020-5208-Fix-buffer-overflows-in-get_lan_param_select.patch of Package ipmitool
From f73d9750428670108c5c727fe2a57b165f2b1142 Mon Sep 17 00:00:00 2001 From: fengtao40 <fengtao40@huawei.com> Date: Tue, 11 Feb 2020 21:16:29 -0500 Subject: [PATCH] Fix buffer overflows in get_lan_param_select --- lib/ipmi_lanp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/ipmi_lanp.c b/lib/ipmi_lanp.c index 65d881b..022c7f1 100644 --- a/lib/ipmi_lanp.c +++ b/lib/ipmi_lanp.c @@ -1809,7 +1809,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert, if (p == NULL) { return (-1); } - memcpy(data, p->data, p->data_len); + memcpy(data, p->data, __min(p->data_len, sizeof(data))); /* set new ipaddr */ memcpy(data+3, temp, 4); printf("Setting LAN Alert %d IP Address to %d.%d.%d.%d\n", alert, @@ -1824,7 +1824,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert, if (p == NULL) { return (-1); } - memcpy(data, p->data, p->data_len); + memcpy(data, p->data, __min(p->data_len, sizeof(data))); /* set new macaddr */ memcpy(data+7, temp, 6); printf("Setting LAN Alert %d MAC Address to " @@ -1838,7 +1838,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert, if (p == NULL) { return (-1); } - memcpy(data, p->data, p->data_len); + memcpy(data, p->data, __min(p->data_len, sizeof(data))); if (strncasecmp(argv[1], "def", 3) == 0 || strncasecmp(argv[1], "default", 7) == 0) { @@ -1864,7 +1864,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert, if (p == NULL) { return (-1); } - memcpy(data, p->data, p->data_len); + memcpy(data, p->data, __min(p->data_len, sizeof(data))); if (strncasecmp(argv[1], "on", 2) == 0 || strncasecmp(argv[1], "yes", 3) == 0) { @@ -1889,7 +1889,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert, if (p == NULL) { return (-1); } - memcpy(data, p->data, p->data_len); + memcpy(data, p->data, __min(p->data_len, sizeof(data))); if (strncasecmp(argv[1], "pet", 3) == 0) { printf("Setting LAN Alert %d destination to PET Trap\n", alert); @@ -1917,7 +1917,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert, if (p == NULL) { return (-1); } - memcpy(data, p->data, p->data_len); + memcpy(data, p->data, __min(p->data_len, sizeof(data))); if (str2uchar(argv[1], &data[2]) != 0) { lprintf(LOG_ERR, "Invalid time: %s", argv[1]); @@ -1933,7 +1933,7 @@ ipmi_lan_alert_set(struct ipmi_intf * intf, uint8_t chan, uint8_t alert, if (p == NULL) { return (-1); } - memcpy(data, p->data, p->data_len); + memcpy(data, p->data, __min(p->data_len, sizeof(data))); if (str2uchar(argv[1], &data[3]) != 0) { lprintf(LOG_ERR, "Invalid retry: %s", argv[1]); -- 2.19.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2