adafruit / Adafruit-PN532

Arduino library for SPI and I2C access to the PN532 RFID/Near Field Communication chip
Other
421 stars 265 forks source link

buffer allocated is too small #107

Closed eco747 closed 1 year ago

eco747 commented 1 year ago

in writecommand, the buffer is not correctly allocated

void Adafruit_PN532::writecommand(uint8_t *cmd, uint8_t cmdlen) {
  if (spi_dev != NULL) {
    // SPI command write.
    uint8_t checksum;
    uint8_t packet[8 + cmdlen];  <<<<<<<<<<<< here, should be 8+cmdLen+1
    uint8_t *p = packet;
    cmdlen++;                            <<<<<<<<<<<< because of this
caternuson commented 1 year ago

Closing. This is a dupe of #106.