From 88ad815d276ee70e5e09e700ecca5014230a1672 Mon Sep 17 00:00:00 2001 From: Adriana Kobylak Date: Tue, 13 Dec 2016 10:09:08 -0600 Subject: ipmid: Fix Get BT Interface Capabilities response Per the IPMI 2.0 spec, the input and output buffer size must be maximum buffer size minus one byte to allocate space for the length byte. Change-Id: Ie1768b9c6844275f7897fbf8056ce2a19b1c11c3 Fixes: openbmc/openbmc#847 Signed-off-by: Adriana Kobylak --- apphandler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apphandler.cpp') diff --git a/apphandler.cpp b/apphandler.cpp index 431cbf0..28d97c9 100644 --- a/apphandler.cpp +++ b/apphandler.cpp @@ -405,7 +405,9 @@ ipmi_ret_t ipmi_app_get_bt_capabilities(ipmi_netfn_t netfn, ipmi_cmd_t cmd, // Status code. ipmi_ret_t rc = IPMI_CC_OK; - uint8_t str[] = {0x01, MAX_IPMI_BUFFER, MAX_IPMI_BUFFER, 0x0A, 0x01}; + // Per IPMI 2.0 spec, the input and output buffer size must be the max + // buffer size minus one byte to allocate space for the length byte. + uint8_t str[] = {0x01, MAX_IPMI_BUFFER-1, MAX_IPMI_BUFFER-1, 0x0A, 0x01}; // Data length *data_len = sizeof(str); -- cgit v1.2.1