lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 24 Jul 2021 23:21:04 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Len Baker <len.baker@....com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Phil Reid <preid@...ctromag.com.au>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        dri-devel <dri-devel@...ts.freedesktop.org>,
        "open list:FRAMEBUFFER LAYER" <linux-fbdev@...r.kernel.org>,
        linux-staging@...ts.linux.dev,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/3] staging/fbtft: Remove all strcpy() uses

On Sat, Jul 24, 2021 at 7:05 PM Len Baker <len.baker@....com> wrote:
>
> strcpy() performs no bounds checking on the destination buffer. This
> could result in linear overflows beyond the end of the buffer, leading
> to all kinds of misbehaviors. The safe replacement is strscpy() but in
> this case it is simpler to use the "%*ph" format specifier.

...

> -       char msg[128];

128 / 4 = 32. So, this buffer is enough to debug print only up to 32
bytes. Hence %*ph replacement won't cut output earlier than requested.

...

> +                       for (j = i + 1; par->init_sequence[j] >= 0; j++);

Why is i + 1 initial for the j? You may rather access the 'i + 1 +
j'th element in the array...

...

> +                                     par->init_sequence[i], j - i - 1,

...and get rid of the ' - i -1' part here.


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ