[curl/curl] e1fcaf: hostip: fix 3 coverity complaints

Daniel Stenberg <[email protected]> Tue, 01 Jun 2021 14:25:15 -0700
Newsgroups gmane.comp.web.curl.cvs
Message-ID <curl/curl/push/refs/heads/master/[email protected]>
  Branch: refs/heads/master
  Home:   https://github.com/curl/curl
  Commit: e1fcaf571f8c7c311b3b38f25a195fab2ad19265
      https://github.com/curl/curl/commit/e1fcaf571f8c7c311b3b38f25a195fab2ad19265
  Author: Daniel Stenberg <[email protected]>
  Date:   2021-06-01 (Tue, 01 Jun 2021)

  Changed paths:
    M lib/hostip.c

  Log Message:
  -----------
  hostip: fix 3 coverity complaints

Follow-up to 1a0ebf6632f889eed

- Check the return code to Curl_inet_pton() in two instances, even
  though we know the input is valid so the functions won't fail.

- Clear the 'struct sockaddr_in' struct before use so that the
  'sin_zero' field isn't left uninitialized.

Detected by Coverity.
Assisted-by: Harry Sintonen
Closes #7163


_______________________________________________
curl-commits mailing list
[email protected]
https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-commits