Hi,

On Tue, Jun 16, 2026 at 1:20 PM David Laight
<[email protected]> wrote:
>
> On Tue, 16 Jun 2026 22:14:54 +0530
> Naveen Kumar Chaudhary <[email protected]> wrote:
>
> > kdb_main.c defines CMD_BUFLEN as 200 (for command history buffers),
> > while kdb_io.c defines it as 256 (for kdb_prompt_str). The snprintf()
> > filling kdb_prompt_str incorrectly used the local CMD_BUFLEN (200),
> > truncating the prompt unnecessarily. Use sizeof(kdb_prompt_str) to
> > always match the actual buffer size.
>
> As a matter of interest what sets the string that kdbgetenv("PROMPT")
> returns?
> If it is user settable, using it as a format string doesn't seem wise
> (even for kdbg).

For some history, see commit ad99b5105c08 ("kdb: Censor attempts to
set PROMPT without ENABLE_MEM_READ").

I have no idea how truly useful it is to be able to mess with your
prompt like this to begin with, but at least the "safety" of it has
been considered a little.

-Doug


_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to