aboutsummaryrefslogtreecommitdiff
path: root/hw/ipmi
diff options
context:
space:
mode:
Diffstat (limited to 'hw/ipmi')
-rw-r--r--hw/ipmi/smbus_ipmi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/ipmi/smbus_ipmi.c b/hw/ipmi/smbus_ipmi.c
index 9ef9112dd5..d0991ab7f9 100644
--- a/hw/ipmi/smbus_ipmi.c
+++ b/hw/ipmi/smbus_ipmi.c
@@ -281,7 +281,9 @@ static int ipmi_write_data(SMBusDevice *dev, uint8_t *buf, uint8_t len)
*/
send = true;
}
- memcpy(sid->inmsg + sid->inlen, buf, len);
+ if (len > 0) {
+ memcpy(sid->inmsg + sid->inlen, buf, len);
+ }
sid->inlen += len;
break;
}