Fix null dereference in ipsec esp_sa_record_add_from_dissector

The esp_sa_record_add_from_dissector function is passing a null pointer to
the err argument of uat_esp_sa_record_update_cb, which then dereferences
it. Apparently esp_sa_record_add_from_dissector is not called anywhere in
Wireshark, but it's exported and available for external code to call it.

Fix by passing a pointer to a local char* instead.

Bug found by clang static analyzer.
This commit is contained in:
Nicolás Alvarez 2021-06-05 20:21:19 -03:00
parent 1718151a65
commit 577282f679
1 changed files with 2 additions and 1 deletions

View File

@ -453,7 +453,8 @@ void esp_sa_record_add_from_dissector(guint8 protocol, const gchar *srcIP, const
record->authentication_key = NULL;
/* Parse keys */
uat_esp_sa_record_update_cb(record, NULL);
char *err = NULL;
uat_esp_sa_record_update_cb(record, &err);
}
/*************************************/