Commit 5cda3af5 authored by Philippe Teuwen's avatar Philippe Teuwen

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));
  ^                                      ~~~
parent 56e9f197
......@@ -3127,6 +3127,9 @@ pn53x_get_information_about(nfc_device *pnd, char **pbuf)
void *
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
if (CHIP_DATA(pnd)->current_target) {
free(CHIP_DATA(pnd)->current_target);
......
......@@ -308,6 +308,8 @@ acr122s_build_frame(nfc_device *pnd,
return false;
if (data_size + should_prefix > 255)
return false;
if (data == NULL)
return false;
struct xfr_block_req *req = (struct xfr_block_req *) &frame[1];
req->message_type = XFR_BLOCK_REQ_MSG;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment