Page MenuHomeFreeBSD

Fix several memory problems in ldns
Needs ReviewPublic

Authored by trix_juniper.net on Feb 19 2017, 4:34 PM.

Details

Reviewers
stevek
des
Summary

str2host.c ldns_str2rdf_str and ldns_str2rdf_long_str have the
same problem. memory assigned to the local pointer 'data' needs
to be freed if the input parameter 'str' is invalid.

radix.c ldns_radix_array_split need to free the memory assigned
to the local pointers 'common' and 's1' when
ldns_radix_prefix_remainer fails and the
ldns_radix_array_split returns.

dnssec_zone.c ldns_dnssec_zone_new_frm_fp_l poison the variable
'newzone' after it is freed so it will not be double freed.

resolver.c ldns_resolver_new_frm_fp_l free the memory assigned
to the local pointer 'r' on error conditions that result in
ldns_resolver_new_frm_fp_l returning

host2str ldns_rdf2buffer_str_ipseckey free the memory assigned
to the local pointer 'gateway_data' on error conditions that
result in the ldns_rdf2buffer_str_ipseckey returning.

Test Plan

Run clang's static analyzer 'scan-build' on each of these files before to show the problem. Run scan-build after to show the problem has been resolved.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

trix_juniper.net retitled this revision from to Fix several memory problems in ldns.
trix_juniper.net updated this object.
trix_juniper.net edited the test plan for this revision. (Show Details)
trix_juniper.net added reviewers: stevek, des.
trix_juniper.net set the repository for this revision to rS FreeBSD src repository.