Skip to content

Commit 1f4fe05

Browse files
committed
Check map->rhs before dereference (CID #1681378)
1 parent 199a122 commit 1f4fe05

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/lib/unlang/compile.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,15 @@ int unlang_fixup_update(map_t *map, void *ctx)
359359
*
360360
* RHS may be NULL for T_OP_CMP_FALSE.
361361
*/
362-
switch (map->rhs->type) {
363-
case TMPL_TYPE_ATTR:
364-
if (map->rhs && !tmpl_is_list(map->rhs)) tmpl_attr_rewrite_leaf_num(map->rhs, NUM_ALL);
365-
break;
366-
367-
default:
368-
break;
362+
if (map->rhs) {
363+
switch (map->rhs->type) {
364+
case TMPL_TYPE_ATTR:
365+
if (!tmpl_is_list(map->rhs)) tmpl_attr_rewrite_leaf_num(map->rhs, NUM_ALL);
366+
break;
367+
368+
default:
369+
break;
370+
}
369371
}
370372
}
371373

0 commit comments

Comments
 (0)