screen-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [screen-devel] [PATCH] Really avoid a potential buffer overflow for


From: david kerns
Subject: Re: [screen-devel] [PATCH] Really avoid a potential buffer overflow for 'home'
Date: Mon, 8 Jul 2024 08:42:53 -0700



On Mon, Jul 8, 2024 at 8:02 AM Alex Naumov <alexander_naumov@opensuse.org> wrote:
On Mon, Jul 8, 2024 at 4:48 PM david kerns <david.t.kerns@gmail.com> wrote:
I'd argue for a global replacement of sprintf(dest, ...)  to snprintf(dest, sizeof(dest)...)
Unfortunately, that's probably not an automated task.
from the man page:
     The snprintf() and vsnprintf() functions will write at most size-1 of the characters printed
     into the output string (the size'th character then gets the terminating ‘\0’); if the return
     value is greater than or equal to the size argument, the string was too short and some of the
     printed characters were discarded.  The output is always null-terminated, unless size is 0.
 
bonus points for checking the return code :)


Nice task. Wanna implement it? :)

OK, give me a couple days...

reply via email to

[Prev in Thread] Current Thread [Next in Thread]