Skip to content

Commit 47ce88e

Browse files
authored
Merge pull request #50 from CESNET/unirec_segv_duplicated_fields
Unirec output: fixed segfault when duplicated field mapping is present
2 parents 259e783 + ac9689d commit 47ce88e

File tree

1 file changed

+3
-3
lines changed
  • extra_plugins/output/unirec/src

1 file changed

+3
-3
lines changed

extra_plugins/output/unirec/src/map.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,9 +480,9 @@ map_sort_fn(const void *p1, const void *p2)
480480
ipfix2 = ipfix2->next;
481481
}
482482

483-
if (ipfix1->next) {
483+
if (ipfix1 && ipfix1->next) {
484484
return -1;
485-
} else if (ipfix2->next) {
485+
} else if (ipfix2 && ipfix2->next) {
486486
return 1;
487487
}
488488

@@ -585,7 +585,7 @@ map_load(map_t *map, const char *file)
585585

586586
// Collision detected!
587587
snprintf(map->err_buffer, ERR_SIZE, "The IPFIX IE '%s' (PEN %" PRIu32 ", ID %" PRIu16 ") "
588-
"is mapped to multiple different UniRec fields ('%s' and '%s')",
588+
"is mapped to multiple UniRec fields ('%s' and '%s')",
589589
rec_now->ipfix.def->name, rec_now->ipfix.en, rec_now->ipfix.id,
590590
rec_now->unirec.name, rec_prev->unirec.name);
591591
map_clear(map);

0 commit comments

Comments
 (0)