From c90d46c4d12eaa7a29945e03a7f715db4b74686e Mon Sep 17 00:00:00 2001 From: Sam Hatchett Date: Wed, 28 Jun 2017 12:13:44 -0400 Subject: [PATCH 1/2] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c03f27e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Open Water Analytics + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 5d687d7d2ca88a535bd6110e4797d310a9511c0e Mon Sep 17 00:00:00 2001 From: Markus Sunela <30700548+makusuko@users.noreply.github.com> Date: Thu, 2 May 2019 16:35:55 +0300 Subject: [PATCH 2/2] Fixed NULL pointer error, if no label is provided after the rule keyword. --- src/rules.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/rules.c b/src/rules.c index 7ad038f..fc63a1c 100755 --- a/src/rules.c +++ b/src/rules.c @@ -237,7 +237,13 @@ int ruledata() { case -1: err = 201; /* Unrecognized keyword */ break; - case r_RULE: Nrules++; + case r_RULE: /* Missing the rule label -> set error */ + if (parser->Ntokens != 2) + { + err = 201; + break; + } + Nrules++; newrule(); RuleState = r_RULE; break;