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

raiden00pl pushed a commit to branch releases/13.0
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/releases/13.0 by this push:
     new 984ef644287 drivers/contactless/pn532: Fix potential overflow
984ef644287 is described below

commit 984ef64428720cb1d6cfea3d3af58ee75a580288
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