lkml.org 
[lkml]   [2023]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Coverity: console_prepend_dropped(): Memory - corruptions
    On (23/01/16 17:35), Petr Mladek wrote:
    >
    > I am going to send a patch.

    Sure, sounds good.

    > The code might be safe with the current size of the buffer and
    > the string. But it is true that the following is wrong:
    >
    > len = snprintf(scratchbuf, scratchbuf_sz,
    > "** %lu printk messages dropped **\n", dropped);

    Wouldn't

    if (WARN_ON_ONCE(len + PRINTK_PREFIX_MAX >= outbuf_sz))
    return;

    prevent us from doing something harmful?

    \
     
     \ /
      Last update: 2023-03-26 23:43    [W:9.400 / U:0.088 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site