Skip to content

Commit ae04ea2

Browse files
committed
conditionals: fix NULL record handling in flb_condition_evaluate
Return FLB_FALSE when record is NULL instead of FLB_TRUE. NULL cond still returns FLB_TRUE (no condition means pass), but NULL record should fail the condition. Signed-off-by: Eduardo Silva <[email protected]>
1 parent 71fd847 commit ae04ea2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/flb_conditionals.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,13 @@ int flb_condition_evaluate_ex(struct flb_condition *cond,
440440
int flb_condition_evaluate(struct flb_condition *cond,
441441
struct flb_mp_chunk_record *record)
442442
{
443-
if (!cond || !record) {
443+
if (!cond) {
444444
return FLB_TRUE;
445445
}
446446

447+
if (!record) {
448+
return FLB_FALSE;
449+
}
450+
447451
return flb_condition_evaluate_ex(cond, record, default_get_record_variant);
448452
}

0 commit comments

Comments
 (0)