1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Filter: Fixed segfault when a case option had an empty block

Thanks to Kobayashi_Bairuo <noc@tohunet.com> for reporting.
This commit is contained in:
Maria Matejka
2023-06-22 16:07:28 +02:00
parent ac7341a181
commit 1499a335f6
3 changed files with 26 additions and 6 deletions

View File

@@ -200,7 +200,7 @@ FID_INTERPRET_BODY()')
# Executing another filter line. This replaces the recursion
# that was needed in the former implementation.
m4_define(LINEX, `FID_INTERPRET_EXEC()LINEX_($1)FID_INTERPRET_NEW()return $1 FID_INTERPRET_BODY()')
m4_define(LINEX_, `do {
m4_define(LINEX_, `do if ($1) {
fstk->estk[fstk->ecnt].pos = 0;
fstk->estk[fstk->ecnt].line = $1;
fstk->estk[fstk->ecnt].ventry = fstk->vcnt;
@@ -227,9 +227,7 @@ if (!f_same(f1->fl$1, f2->fl$1)) return 0;
FID_ITERATE_BODY()m4_dnl
if (whati->fl$1) BUFFER_PUSH(fit->lines) = whati->fl$1;
FID_INTERPRET_EXEC()m4_dnl
do { if (whati->fl$1) {
LINEX_(whati->fl$1);
} } while(0)
LINEX_(whati->fl$1)
FID_INTERPRET_NEW()m4_dnl
return whati->f$1
FID_INTERPRET_BODY()')