In both of these cases buf is NULL if and only if the size is also 0,
and thus we'll fail the test anyway, but coverify isn't noticing that.
And I'm tired of talking to a piece of software about its deficiencies.
Signed-off-by: Peter Jones <pjones@redhat.com>
hw->length = EDD10_HARDWARE_VENDOR_PATH_LENGTH;
memcpy(&(hw->vendor_guid), &guid, sizeof(guid));
*data = hardware_device;
- if (size >= hw->length)
+ if (size >= hw->length && buf != NULL)
memcpy(buf, buffer, hw->length);
return hw->length;
}
if (signature) memcpy(p.signature, signature, 16);
p.mbr_type = mbr_type;
p.signature_type = signature_type;
- if (size >= p.length)
+ if (size >= p.length && buf != NULL)
memcpy(buf, &p, p.length);
return p.length;
}