Skip to content

Commit

Permalink
NetworkPkg: Fix invalid pointer for DNS response token on error
Browse files Browse the repository at this point in the history
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3719

This issue is introduced by the commit 43d7e60.
Token->RspData.H2AData is de-allocated on error but it is not
set to NULL. HTTP module attempts to free again and cause assert.

Signed-off-by: Baraneedharan Anbazhagan <[email protected]>
Reviewed-by: Wu Jiaxin <[email protected]>
  • Loading branch information
lgao4 committed Nov 26, 2021
1 parent 4c7ce0d commit bb1bba3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NetworkPkg/DnsDxe/DnsImpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1700,6 +1700,7 @@ ParseDnsResponse (
}

FreePool (Dns4TokenEntry->Token->RspData.H2AData);
Dns4TokenEntry->Token->RspData.H2AData = NULL;
}
}
}
Expand Down Expand Up @@ -1731,6 +1732,7 @@ ParseDnsResponse (
}

FreePool (Dns6TokenEntry->Token->RspData.H2AData);
Dns6TokenEntry->Token->RspData.H2AData = NULL;
}
}
}
Expand Down

0 comments on commit bb1bba3

Please sign in to comment.