]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Replace strcpy() call with strlcpy() call
authorFrancois-Xavier Le Bail <[email protected]>
Fri, 26 Jan 2018 11:29:37 +0000 (12:29 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 15 Jul 2018 21:46:47 +0000 (23:46 +0200)
strcpy() in unsafe.

(backported from commit 11d0d329 in master)

addrtoname.c

index df7c2cee9461f8e1c081b87a3af34bd619af9985..a30886a7c2ed4f5a9427bff08c63e37907a74b4b 100644 (file)
@@ -120,7 +120,7 @@ win32_gethostbyaddr(const char *addr, int len, int type)
                    hname, sizeof(hname), NULL, 0, 0)) {
                        return NULL;
                } else {
-                       strcpy(host.h_name, hname);
+                       strlcpy(host.h_name, hname, NI_MAXHOST);
                        return &host;
                }
                break;