mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-11-22 10:27:54 +00:00
CLIParamStrToBuf() refused only strings longer than maxdatalen, then copied the string with its terminator. Most direct callers pass the buffer size, so a string that fills the buffer gets its terminator written one byte past it, e.g. hf mf view -f with a 1000-char name. The check was ibuf + 1 > maxdatalen inaa3d29e6aand became ibuf > maxdatalen inc2d5a7d74. CLIParamStrToBuf() takes the buffer size again and refuses a string that leaves no byte for the terminator. CLIGetStrWithReturn passes *datalen + 1, since its callers give the maximum number of chars. The direct calls that passed the buffer size - 1 or the field length pass the buffer size. The uid buffers of hf mf restore and hf mf hardnested get one more byte, so the 20 hex chars of a 10-byte UID and the 14 of a 7-byte UID are still accepted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>