Files
proxmark3/armsrc
iceman1001 592977c217 armsrc: zero the command payload when a packet arrives, not on every idle poll
The main loop cleared the whole PacketCommandNG payload before every call to
receive_ng(), so a device sitting idle memset PM3_CMD_DATA_SIZE bytes on each
pass of the loop whether anything was arriving or not. The zeroing belongs
inside receive_ng_internal(), once the preamble has been read and a packet is
known to be coming in, and that is where it is now.

It has to be before either branch fills the payload, because neither fills all
of it: an NG command writes only its own length, and an old style one only
PM3_CMD_DATA_SIZE_OLD. Whatever is not written has to start at zero.

Moving it also covers two callers that never had it. appmain.c has a second
receive_ng() that drains the buffer on a mode switch, and iclass.c has one that
picks up EML_MEMSET commands while waiting for RF. Both declare their
PacketCommandNG without initialising it, and the iclass one then reads a struct
out of the payload -- so a command shorter than that struct was reading stack
garbage beyond its length. That is fixed as a side effect.

Builds for RDV4 and PM5.

Thanks to @Msprg et al
2026-09-16 02:14:48 +02:00
..
…
2026-09-15 23:59:01 +02:00
2026-08-19 15:32:39 +02:00
2026-09-05 18:09:46 +02:00
2026-09-15 23:59:01 +02:00
2026-08-28 13:10:24 +02:00
2026-08-28 13:10:24 +02:00
2026-09-04 06:21:20 +02:00
2026-09-01 17:57:31 +02:00
…
…
2026-09-15 08:36:13 +02:00
…
…
2026-09-15 20:41:22 +02:00
…
…
2026-09-15 08:10:09 +02:00
…
2026-08-28 22:35:08 +02:00
2026-06-12 18:31:57 +03:00
2026-08-19 15:32:39 +02:00
2026-06-12 18:31:57 +03:00
2026-07-15 16:39:15 +02:00
…
2026-09-15 08:36:13 +02:00
…
2026-09-15 08:36:13 +02:00
…
2026-09-15 08:21:25 +02:00
2026-09-15 08:36:13 +02:00
2026-09-15 16:02:46 +08:00
2026-09-15 08:03:54 +02:00
2026-08-29 15:00:03 +02:00
2026-09-15 22:57:37 +02:00
2026-09-15 22:57:37 +02:00
2026-09-15 08:10:09 +02:00
2026-09-15 08:21:25 +02:00
2026-08-19 15:32:39 +02:00
…
2026-08-19 15:32:39 +02:00
2026-09-15 08:17:05 +02:00
2026-09-14 19:56:57 +02:00
…
2026-09-15 08:29:06 +02:00
2026-08-29 16:03:00 +02:00
2026-08-19 15:32:39 +02:00
…
…
…
…
…
2026-08-28 13:10:24 +02:00
2026-09-15 08:21:25 +02:00
2026-09-01 13:34:02 +02:00
…
…
2026-09-08 16:04:45 +08:00
2026-09-05 22:31:52 +08:00
2026-09-15 08:17:05 +02:00
2026-04-13 09:35:02 +02:00
2026-08-19 15:32:39 +02:00
…
2026-09-15 08:17:05 +02:00
2026-08-19 15:32:39 +02:00
…
2026-09-15 08:36:13 +02:00
2026-09-01 13:34:23 +02:00
…
2026-09-01 13:32:49 +02:00
…
…
…
…