|
From: | david kerns |
Subject: | Re: [screen-devel] [PATCH] Really avoid a potential buffer overflow for 'home' |
Date: | Tue, 9 Jul 2024 06:19:17 -0700 |
On Mon, Jul 8, 2024 at 5:43 PM david kerns <david.t.kerns@gmail.com> wrote: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 theprinted 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...Take your time. We can add it after release also. I'm going to release new versions much more often.
[Prev in Thread] | Current Thread | [Next in Thread] |