diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2022-09-10 15:44:31 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2022-09-10 15:44:31 +0200 |
commit | 36a24e9032591da8cc7688f69e7e9f5f41ffe4ab (patch) | |
tree | eec9b06cd7f4498ef4db3e2f7973e08904981c48 /lib/ipmi_session.c | |
parent | dce3efdab4ea7314a3e1db3af2cb0aac3f48dcef (diff) |
New upstream release
Diffstat (limited to 'lib/ipmi_session.c')
-rw-r--r-- | lib/ipmi_session.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/ipmi_session.c b/lib/ipmi_session.c index 141f0f4..b9af1fd 100644 --- a/lib/ipmi_session.c +++ b/lib/ipmi_session.c @@ -309,8 +309,10 @@ ipmi_get_session_info(struct ipmi_intf * intf, } else { - memcpy(&session_info, rsp->data, rsp->data_len); - print_session_info(&session_info, rsp->data_len); + memcpy(&session_info, rsp->data, + __min(rsp->data_len, sizeof(session_info))); + print_session_info(&session_info, + __min(rsp->data_len, sizeof(session_info))); } break; @@ -341,8 +343,10 @@ ipmi_get_session_info(struct ipmi_intf * intf, break; } - memcpy(&session_info, rsp->data, rsp->data_len); - print_session_info(&session_info, rsp->data_len); + memcpy(&session_info, rsp->data, + __min(rsp->data_len, sizeof(session_info))); + print_session_info(&session_info, + __min(rsp->data_len, sizeof(session_info))); } while (i <= session_info.session_slot_count); break; |