Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ospfd: Function order caused use after free. #5310

Merged
merged 1 commit into from
Nov 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ospfd/ospf_opaque.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,9 @@ void ospf_delete_opaque_functab(uint8_t lsa_type, uint8_t opaque_type)
/* Cleanup internal control information, if it
* still remains. */
if (functab->oipt != NULL) {
free_opaque_info_owner(functab->oipt);
free_opaque_info_per_type(
functab->oipt);
free_opaque_info_owner(functab->oipt);
}

/* Dequeue listnode entry from the list. */
Expand Down Expand Up @@ -554,8 +554,8 @@ register_opaque_info_per_type(struct ospf_opaque_functab *functab,
case OSPF_OPAQUE_AS_LSA:
top = ospf_lookup_by_vrf_id(new->vrf_id);
if (new->area != NULL && (top = new->area->ospf) == NULL) {
free_opaque_info_per_type((void *)oipt);
free_opaque_info_owner(oipt);
free_opaque_info_per_type(oipt);
oipt = NULL;
goto out; /* This case may not exist. */
}
Expand All @@ -567,8 +567,8 @@ register_opaque_info_per_type(struct ospf_opaque_functab *functab,
EC_OSPF_LSA_UNEXPECTED,
"register_opaque_info_per_type: Unexpected LSA-type(%u)",
new->data->type);
free_opaque_info_per_type((void *)oipt);
free_opaque_info_owner(oipt);
free_opaque_info_per_type(oipt);
oipt = NULL;
goto out; /* This case may not exist. */
}
Expand Down