check return value of nftnl_expr_get()

This commit is contained in:
Thomas Bernard 2020-06-01 20:20:29 +02:00
parent 1e37a9f7b5
commit 5dbdc50aa7
1 changed files with 4 additions and 0 deletions

View File

@ -365,6 +365,10 @@ parse_rule_cmp(struct nftnl_expr *e, rule_t *r)
} }
data_val = nftnl_expr_get(e, NFTNL_EXPR_CMP_DATA, &data_len); data_val = nftnl_expr_get(e, NFTNL_EXPR_CMP_DATA, &data_len);
if (data_val == NULL) {
log_error( "parse_rule_cmp: nftnl_expr_get(NFTNL_EXPR_CMP_DATA) returned NULL");
return;
}
switch (r->reg1_type) { switch (r->reg1_type) {
case RULE_REG_IIF: case RULE_REG_IIF: