mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 10:37:22 +00:00
ID: 3578277 - 'lib/ipmi_fru.c' - possible NULL pointer
Commit fixes possible NULL pointer by adding check whether fru_bloc, returned from build_fru_bloc(), is NULL or not. If it is, print an error message and return (-1).
This commit is contained in:
parent
d65cccc32a
commit
a9f7a7b92e
@ -497,6 +497,11 @@ write_fru_area(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id,
|
||||
|
||||
t_ipmi_fru_bloc * fru_bloc = build_fru_bloc(intf, fru, id, &num_bloc);
|
||||
|
||||
if (fru_bloc == NULL) {
|
||||
lprintf(LOG_ERROR, "Failed to build FRU bloc.");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_STORAGE;
|
||||
req.msg.cmd = SET_FRU_DATA;
|
||||
|
Loading…
x
Reference in New Issue
Block a user