From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751930AbbESU2o (ORCPT ); Tue, 19 May 2015 16:28:44 -0400 Received: from smtprelay0035.hostedemail.com ([216.40.44.35]:48522 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750993AbbESU2n (ORCPT ); Tue, 19 May 2015 16:28:43 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2828:2914:3138:3139:3140:3141:3142:3167:3352:3622:3865:3868:3870:3871:3872:3874:4321:5007:6261:6742:7903:10004:10400:10848:11232:11658:11914:12517:12519:12740:13069:13141:13230:13311:13357:14096:14097:21080:21088,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: hour24_2e9e89d500d3d X-Filterd-Recvd-Size: 2382 Message-ID: <1432067319.2870.211.camel@perches.com> Subject: Re: [PATCH] x86, cpuinfo x86_model_id whitespace cleanup From: Joe Perches To: Andy Lutomirski Cc: Borislav Petkov , "linux-kernel@vger.kernel.org" , Fenghua Yu , Dave Hansen , Thomas Gleixner , Denys Vlasenko , Ingo Molnar , Brian Gerst , "H. Peter Anvin" , Igor Mammedov , the arch/x86 maintainers , Prarit Bhargava Date: Tue, 19 May 2015 13:28:39 -0700 In-Reply-To: <1432067178.2870.209.camel@perches.com> References: <1432050210-32036-1-git-send-email-prarit@redhat.com> <20150519181334.GM4641@pd.tnic> <20150519192206.GN4641@pd.tnic> <1432067178.2870.209.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 wrote: > > > On Tue, May 19, 2015 at 11:44:41AM -0700, Andy Lutomirski wrote: > > >> On May 19, 2015 11:13 AM, "Borislav Petkov" 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)