From patchwork Thu Jan 18 10:32:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Bumiller X-Patchwork-Id: 862812 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zMgJb4Gdlz9s83 for ; Thu, 18 Jan 2018 21:32:47 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755830AbeARKco (ORCPT ); Thu, 18 Jan 2018 05:32:44 -0500 Received: from proxmox-new.maurer-it.com ([212.186.127.180]:31382 "EHLO proxmox-new.maurer-it.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755843AbeARKck (ORCPT ); Thu, 18 Jan 2018 05:32:40 -0500 Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 76C3D42710; Thu, 18 Jan 2018 11:32:39 +0100 (CET) From: Wolfgang Bumiller To: netdev@vger.kernel.org Cc: Stephen Hemminger , Jamal Hadi Salim , Cong Wang , Jiri Pirko , "David S . Miller" Subject: [PATCH iproute2] tc/lexer: let quotes actually start strings Date: Thu, 18 Jan 2018 11:32:34 +0100 Message-Id: <20180118103236.32494-2-w.bumiller@proxmox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180118103236.32494-1-w.bumiller@proxmox.com> References: <20180118103236.32494-1-w.bumiller@proxmox.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The lexer will go with the longest match, so previously the starting double quotes of a string would be swallowed by the [^ \t\r\n()]+ pattern leaving the user no way to actually use strings with escape sequences. Fix this by not allowing this case to start with double quotes. Signed-off-by: Wolfgang Bumiller --- tc/emp_ematch.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tc/emp_ematch.l b/tc/emp_ematch.l index dc106759..d7a99304 100644 --- a/tc/emp_ematch.l +++ b/tc/emp_ematch.l @@ -137,7 +137,7 @@ ")" { return yylval.i = *yytext; } -[^ \t\r\n()]+ { +[^" \t\r\n()][^ \t\r\n()]* { yylval.b = bstr_alloc(yytext); if (yylval.b == NULL) return ERROR;