Files
Gabriele GristinaandClaude Opus 5.5 5d447cd1a6 cliparser: keep a string option's terminator inside its buffer
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 in aa3d29e6a and became
ibuf > maxdatalen in c2d5a7d74.

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>
2026-11-12 21:45:08 +01:00
..
2025-10-17 15:26:42 +02:00
2026-05-24 03:33:38 -04:00
2025-09-21 16:41:30 +03:00
2026-07-15 16:39:15 +02:00
2026-09-27 21:15:18 +02:00
2025-03-25 23:25:20 +01:00
2026-05-21 20:54:44 +02:00
2020-05-08 17:04:28 +02:00
2024-01-07 17:00:52 +01:00
2026-05-19 09:36:32 +02:00