]> 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]>
Fri, 26 Jan 2018 11:30:04 +0000 (12:30 +0100)
strcpy() in unsafe.

addrtoname.c

index 5593792934a07e11b771670a56389806ba215993..499a6648d2a76cb9eb17af274d24671714d739df 100644 (file)
@@ -172,7 +172,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;