Revert "dsp: platform: Fix decode_set_event_receiver_req()"
This reverts commit 8c43abb70aeadde39d99af2c1b6b5d4a1416fc47.
As found in openbmc/pldm@35f25949fe4d ("Fix invalid read by adjusting
request size") the change in 8c43abb70aea ("dsp: platform: Fix
decode_set_event_receiver_req()") reduces the value of
PLDM_SET_EVENT_RECEIVER_REQ_BYTES and causes an out-of-bounds access.
A new macro should be introduced rather than changing the value of
PLDM_SET_EVENT_RECEIVER_REQ_BYTES.
Change-Id: I922c7eff86919f513e302bec393c0a516046e923
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/src/dsp/platform.c b/src/dsp/platform.c
index a800da5..4b6898e 100644
--- a/src/dsp/platform.c
+++ b/src/dsp/platform.c
@@ -2429,16 +2429,9 @@
}
pldm_msgbuf_extract_p(buf, event_message_global_enable);
- if (rc) {
- return rc;
- }
-
pldm_msgbuf_extract_p(buf, transport_protocol_type);
pldm_msgbuf_extract_p(buf, event_receiver_address_info);
- if ((*event_message_global_enable ==
- PLDM_EVENT_MESSAGE_GLOBAL_ENABLE_ASYNC_KEEP_ALIVE)) {
- pldm_msgbuf_extract_p(buf, heartbeat_timer);
- }
+ pldm_msgbuf_extract_p(buf, heartbeat_timer);
rc = pldm_msgbuf_destroy(buf);
if (rc) {