Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751869AbbESU0X (ORCPT ); Tue, 19 May 2015 16:26:23 -0400 Received: from smtprelay0174.hostedemail.com ([216.40.44.174]:57012 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751072AbbESU0W (ORCPT ); Tue, 19 May 2015 16:26:22 -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:1539: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:13161:13229:13230:13311:13357: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: nerve78_1a1f8e0ba940a X-Filterd-Recvd-Size: 2252 Message-ID: <1432067178.2870.209.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:26:18 -0700 In-Reply-To: References: <1432050210-32036-1-git-send-email-prarit@redhat.com> <20150519181334.GM4641@pd.tnic> <20150519192206.GN4641@pd.tnic> 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 Content-Length: 956 Lines: 25 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/