lkml.org 
[lkml]   [2015]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH] x86, cpuinfo x86_model_id whitespace cleanup
    From
    Date
    On Tue, 2015-05-19 at 13:26 -0700, Joe Perches wrote:
    > iOn Tue, 2015-05-19 at 13:16 -0700, Andy Lutomirski wrote:
    > > On Tue, May 19, 2015 at 12:22 PM, Borislav Petkov <bp@alien8.de> wrote:
    > > > On Tue, May 19, 2015 at 11:44:41AM -0700, Andy Lutomirski wrote:
    > > >> On May 19, 2015 11:13 AM, "Borislav Petkov" <bp@alien8.de> wrote:
    > > >> >
    > > >> > On Tue, May 19, 2015 at 01:25:59PM -0400, Brian Gerst wrote:
    > > >> > > Using strlcpy in this manner could fail if it does larger than byte
    > > >> > > copies and they overlap.
    > > >> >
    > > >> > Why?
    >
    > I think this is traditionally handled by specifying that
    > the strcpy strings may not overlap, so the suggested
    >
    > + strlcpy(c->x86_model_id, strim(c->x86_model_id), 48);
    >
    > isn't good code.
    >
    > A temporary intermediate buffer is required.

    Or memmove. (duh)




    \
     
     \ /
      Last update: 2015-05-19 23:01    [W:7.505 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site