Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757805Ab3FCNdG (ORCPT ); Mon, 3 Jun 2013 09:33:06 -0400 Received: from jdl.com ([208.123.74.7]:45576 "EHLO jdl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754755Ab3FCNdF (ORCPT ); Mon, 3 Jun 2013 09:33:05 -0400 Message-Id: To: Stephen Warren cc: David Gibson , devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, mmarek@suse.cz, rob.herring@calxeda.com, grant.likely@secretlab.ca, linux-kbuild@vger.kernel.org, Stephen Warren Subject: Re: [PATCH V2] dtc: ensure #line directives don't consume data from the next line In-reply-to: <1370025184-23808-1-git-send-email-swarren@wwwdotorg.org> References: <1370025184-23808-1-git-send-email-swarren@wwwdotorg.org> Comments: In-reply-to Stephen Warren message dated "Fri, 31 May 2013 12:33:04 -0600." Date: Mon, 03 Jun 2013 08:32:54 -0500 From: Jon Loeliger X-Spam-Score: 0.8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1355 Lines: 33 > From: Stephen Warren > > Previously, the #line parsing regex ended with ({WS}+[0-9]+)?. The {WS} > could match line-break characters. If the #line directive did not contain > the optional flags field at the end, this could cause any integer data on > the next line to be consumed as part of the #line directive parsing. This > could cause syntax errors (i.e. #line parsing consuming the leading 0 > from a hex literal 0x1234, leaving x1234 to be parsed as cell data, > which is a syntax error), or invalid compilation results (i.e. simply > consuming literal 1234 as part of the #line processing, thus removing it > from the cell data). > > Fix this by replacing {WS} with [ \t] so that it can't match line-breaks. > > Convert all instances of {WS}, even though the other instances should be > irrelevant for any well-formed #line directive. This is done for > consistency and ultimate safety. > > Reported-by: Ian Campbell > Signed-off-by: Stephen Warren > --- > v2: Convert all instances of {WS} in the regex. Applied. Thanks! jdl -- 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/