Skip to content

Commit

Permalink
Merge pull request #50 from CESNET/unirec_segv_duplicated_fields
Browse files Browse the repository at this point in the history
Unirec output: fixed segfault when duplicated field mapping is present
  • Loading branch information
Lukas955 authored Oct 18, 2021
2 parents 259e783 + ac9689d commit 47ce88e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extra_plugins/output/unirec/src/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,9 @@ map_sort_fn(const void *p1, const void *p2)
ipfix2 = ipfix2->next;
}

if (ipfix1->next) {
if (ipfix1 && ipfix1->next) {
return -1;
} else if (ipfix2->next) {
} else if (ipfix2 && ipfix2->next) {
return 1;
}

Expand Down Expand Up @@ -585,7 +585,7 @@ map_load(map_t *map, const char *file)

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

0 comments on commit 47ce88e

Please sign in to comment.