This is an automated email from the ASF dual-hosted git repository.

lupyuen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 9e9926317d1 drivers/contactless/pn532: Fix potential overflow
9e9926317d1 is described below

commit 9e9926317d15c6398d295a7b20b3059b7ac0574c
Author: Matteo Golin <[email protected]>
AuthorDate: Sat Jun 6 16:54:27 2026 -0400

    drivers/contactless/pn532: Fix potential overflow
    
    Fixes a potential overflow where more than 16 bytes are written to the
    cmd_buffer.
    
    Signed-off-by: Matteo Golin <[email protected]>
---
 drivers/contactless/pn532.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/contactless/pn532.c b/drivers/contactless/pn532.c
index bd93de40545..722ca843ea1 100644
--- a/drivers/contactless/pn532.c
+++ b/drivers/contactless/pn532.c
@@ -794,6 +794,7 @@ bool pn532_set_rf_config(struct pn532_dev_s * dev,
 
   pn532_frame_init(f, PN532_COMMAND_RFCONFIGURATION);
   f->data[1] = conf->cfg_item;
+  DEBUGASSERT(conf->data_size <= 16);
   memcpy(&f->data[2], conf->config, conf->data_size);
   f->len += conf->data_size + 1;
   pn532_frame_finish(f);

Reply via email to