Fix warnings Null pointer passed as an argument to a nonnull parameter
acr122s.c:331:3: warning: Null pointer passed as an argument to a 'nonnull' parameter memcpy(buf, data, data_size); ^ ~~~~ pn53x.c:3138:3: warning: Null pointer passed as an argument to a 'nonnull' parameter memcpy(CHIP_DATA(pnd)->current_target, pnt, sizeof(nfc_target)); ^ ~~~
This commit is contained in:
parent
56e9f1978d
commit
5cda3af5d4
2 changed files with 5 additions and 0 deletions
|
@ -3127,6 +3127,9 @@ pn53x_get_information_about(nfc_device *pnd, char **pbuf)
|
||||||
void *
|
void *
|
||||||
pn53x_current_target_new(const struct nfc_device *pnd, const nfc_target *pnt)
|
pn53x_current_target_new(const struct nfc_device *pnd, const nfc_target *pnt)
|
||||||
{
|
{
|
||||||
|
if (pnt == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
// Keep the current nfc_target for further commands
|
// Keep the current nfc_target for further commands
|
||||||
if (CHIP_DATA(pnd)->current_target) {
|
if (CHIP_DATA(pnd)->current_target) {
|
||||||
free(CHIP_DATA(pnd)->current_target);
|
free(CHIP_DATA(pnd)->current_target);
|
||||||
|
|
|
@ -308,6 +308,8 @@ acr122s_build_frame(nfc_device *pnd,
|
||||||
return false;
|
return false;
|
||||||
if (data_size + should_prefix > 255)
|
if (data_size + should_prefix > 255)
|
||||||
return false;
|
return false;
|
||||||
|
if (data == NULL)
|
||||||
|
return false;
|
||||||
|
|
||||||
struct xfr_block_req *req = (struct xfr_block_req *) &frame[1];
|
struct xfr_block_req *req = (struct xfr_block_req *) &frame[1];
|
||||||
req->message_type = XFR_BLOCK_REQ_MSG;
|
req->message_type = XFR_BLOCK_REQ_MSG;
|
||||||
|
|
Loading…
Reference in a new issue