From 87540ecf2ac1df871c0754caa9af3f01a9ddacf2 Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Mon, 27 Jun 2005 22:23:34 +0000 Subject: [PATCH] don't spin while waiting for 0 bytes in case BMC lies about how much data is in a FRU --- ipmitool/lib/ipmi_fru.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ipmitool/lib/ipmi_fru.c b/ipmitool/lib/ipmi_fru.c index 0596329..b7734fb 100644 --- a/ipmitool/lib/ipmi_fru.c +++ b/ipmitool/lib/ipmi_fru.c @@ -232,6 +232,13 @@ read_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, tmp = fru->access ? rsp->data[0] << 1 : rsp->data[0]; memcpy((frubuf + off), rsp->data + 1, tmp); off += tmp; + + /* sometimes the size returned in the Info command + * is too large. return 0 so higher level function + * still attempts to parse what was returned */ + if (tmp == 0 && off < finish) + return 0; + } while (off < finish); if (off < finish)