From b7579b94c06affa95e1d7af6855fd861e54ff824 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Mon, 22 May 2017 16:18:04 +0100 Subject: [PATCH] Fix infinite recursion in grammar for depends Allowing listseparator to be empty allows an infinite recursion in the versionedpackagelist rule Also make the comment documenting versionedpackageentry is non-empty consistent with all other similar comments Also allow lower-case depends: --- inilex.ll | 2 +- iniparse.yy | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inilex.ll b/inilex.ll index 798a04b6..b454f0f7 100644 --- a/inilex.ll +++ b/inilex.ll @@ -121,7 +121,7 @@ B64 [a-zA-Z0-9_-] "category:"|"Section:" return CATEGORY; "requires:" return REQUIRES; -"Depends:" return DEPENDS; +[dD]"epends:" return DEPENDS; ^{STR}":" ignore_line (); diff --git a/iniparse.yy b/iniparse.yy index d7684004..8ee7dc3e 100644 --- a/iniparse.yy +++ b/iniparse.yy @@ -132,12 +132,12 @@ versionedpackagelistsp /* non-empty */ | versionedpackagelistsp versionedpackageentry ; -listseparator: /* empty */ - | COMMA +listseparator /* non-empty */ + : COMMA | COMMA NL ; -versionedpackageentry /* empty not allowed */ +versionedpackageentry /* non-empty */ : STRING { iniBuilder->buildPackageListNode($1); } versioncriteria ; -- 2.43.5