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 allocation too small #106

Closed eco747 closed 1 year ago

eco747 commented 1 year ago

In the writeCommand, the buffer is too small (line 1734)

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++;
caternuson commented 1 year ago

Closing. Should be fixed by #109.