Bug reported by the clang static analyzer.
Description: Null pointer passed as an argument to a 'nonnull' parameter
File: libnfc/drivers/acr122_usb.c
Line: 570
I have no idea how to fix that.
A line 569 we have:
DRIVER_DATA(pnd)->apdu_frame.apdu_header.bLen = (data ? data_len : le); // XXX This line is a bit tricky ^^: bLen is Lc when data != NULL... otherwise its Le.
so data may be NULL if we test its value using (data ? data_len : le)
Then at line 570 we have:
memcpy(DRIVER_DATA(pnd)->apdu_frame.apdu_payload, data, data_len);
If data is NULL then crash!
Something is wrong/strange in this code.
Original issue reported on code.google.com by ludovic....@gmail.com on 2 Mar 2013 at 12:19
Original issue reported on code.google.com by
ludovic....@gmail.com
on 2 Mar 2013 at 12:19