[LTP] read_all: Fix buffer too small for long paths
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Sun Sep 6 18:02:56 CEST 2026
Hi Michael,
On Sun, 06 Sep 2026 16:56:50 +0300, Michael Menasherov wrote:
> read_all: Fix buffer too small for long paths
> -#define BUFFER_SIZE 1024
> +#define BUFFER_SIZE 4096
queue_pop() still aborts for a 4095-byte pathname: after copying its final
byte, ++j is 4095, which satisfies BUFFER_SIZE - 1. Use PATH_MAX for popped
and compare j against PATH_MAX so every pathname that fits dent_path also
fits the queue buffer.
Verdict - Needs revision
Pre-existing issue:
read_all.c:218 has an unnecessary blank line before a closing brace, as
reported by make check.
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
More information about the ltp
mailing list