summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2010-12-03 01:14:27 +0100
committerPatrick McHardy <kaber@trash.net>2010-12-03 01:14:27 +0100
commit979a156671020c1e21bbc714d9fbd5ba2443f7da (patch)
tree0ca47480e3d7a054e9843f5e0ce3a0d8465ce4af
parent642e927e21c5c09be6c9f4714328016dcc593557 (diff)
parser: fix minor bugs
- use-after-free in cluster resolution - missing parameter propagation in MNSS parameter parsing Signed-off-by: Patrick McHardy <kaber@trash.net>
-rw-r--r--src/cmd-parser.y11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/cmd-parser.y b/src/cmd-parser.y
index 5d72e95..081d6cb 100644
--- a/src/cmd-parser.y
+++ b/src/cmd-parser.y
@@ -271,17 +271,17 @@ cluster : STRING
struct dect_handle_priv *priv;
priv = dect_handle_get_by_name($1);
- free($1);
-
if (priv == NULL) {
char buf[256];
snprintf(buf, sizeof(buf), "cluster '%s' does not exist\n", $1);
+ free($1);
yyerror(&@1, scanner, state, buf);
YYABORT;
- } else
+ } else {
+ free($1);
$$ = priv->dh;
-
+ }
}
;
@@ -408,6 +408,9 @@ mnss_param_alloc :
;
mnss_params : mnss_param
+ {
+ $$ = $<mnss_param>-1;
+ }
| mnss_params ',' mnss_param
;