Attached is a patch to fix the following issues: 1) Replacing all inet_aton() uses with inet_pton() with error checking. 2) Replacing all inet_ntoa() uses with inet_ntop() with error checking.3) Make sure the return values are checked on existing inet_pton() usage. I noticed inconsistent usage of this function. A non-zero return value from inet_pton() does not indicate success. Success is >0, failure is <=0. 4) Make sure the return values are checked on existing inet_ntop() usage. A NULL return value indicates failure.
I did not scan around the code much surrounding these function calls. I followed functionality that made sense for the usage I saw, which for the most part meant using nm_warning() and continuing (and storing a NULL for failed string conversions).
On a side note, I noticed a lot of instances of ip4_address_to_string() all over the code (sometimes called ip_address_to_string). Might be a candidate for libnm-util.
Attachment:
NetworkManager-address-conversion.patch
Description: Binary data
-- David Cantrell <dcantrell redhat com> Red Hat / Honolulu, HI