Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-09-30 02:57:14 +0300
committerJunio C Hamano <gitster@pobox.com>2016-09-30 02:57:14 +0300
commitfff948fe0e24d8f537b91c1de0349dc2e105dcd9 (patch)
treeaf687d705ee7bec7b2f20e8a7f65b4527b2dedbe /ident.c
parent938c2a63212847bf87fc2a7076ccd4e15dfa3955 (diff)
parentc375a7efa3a42afc51385659437f04027ed106b1 (diff)
Merge branch 'jk/ident-ai-canonname-could-be-null'
In the codepath that comes up with the hostname to be used in an e-mail when the user didn't tell us, we looked at ai_canonname field in struct addrinfo without making sure it is not NULL first. * jk/ident-ai-canonname-could-be-null: ident: handle NULL ai_canonname
Diffstat (limited to 'ident.c')
-rw-r--r--ident.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ident.c b/ident.c
index 92c3cca510..ac4ae02b48 100644
--- a/ident.c
+++ b/ident.c
@@ -101,7 +101,7 @@ static int canonical_name(const char *host, struct strbuf *out)
memset (&hints, '\0', sizeof (hints));
hints.ai_flags = AI_CANONNAME;
if (!getaddrinfo(host, NULL, &hints, &ai)) {
- if (ai && strchr(ai->ai_canonname, '.')) {
+ if (ai && ai->ai_canonname && strchr(ai->ai_canonname, '.')) {
strbuf_addstr(out, ai->ai_canonname);
status = 0;
}