mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
when caching sdrs from file leave room for trailing null to end description string
This commit is contained in:
parent
0f3c980b49
commit
df7d0e6ee6
@ -3244,13 +3244,13 @@ ipmi_sdr_list_cache_fromfile(struct ipmi_intf * intf, const char * ifile)
|
||||
sdrr->id = header.id;
|
||||
sdrr->type = header.type;
|
||||
|
||||
rec = malloc(header.length);
|
||||
rec = malloc(header.length + 1);
|
||||
if (rec == NULL) {
|
||||
lprintf(LOG_ERR, "ipmitool: malloc failure");
|
||||
ret = -1;
|
||||
break;
|
||||
}
|
||||
memset(rec, 0, header.length);
|
||||
memset(rec, 0, header.length + 1);
|
||||
|
||||
bc = fread(rec, 1, header.length, fp);
|
||||
if (bc != header.length) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user