]> git.ipfire.org Git - thirdparty/git.git/blobdiff - ident.c
use HOST_NAME_MAX to size buffers for gethostname(2)
[thirdparty/git.git] / ident.c
diff --git a/ident.c b/ident.c
index d17b5bd341eccd604c849201fb1f13153be9736e..8ec0f25987540ccf64230b6aad4c6e2323d43455 100644 (file)
--- a/ident.c
+++ b/ident.c
@@ -120,7 +120,7 @@ static int canonical_name(const char *host, struct strbuf *out)
 
 static void add_domainname(struct strbuf *out, int *is_bogus)
 {
-       char buf[1024];
+       char buf[HOST_NAME_MAX + 1];
 
        if (gethostname(buf, sizeof(buf))) {
                warning_errno("cannot get host name");