From ff8d9e8fcecc3cc8ace64b6cdeafdb11cf9854f3 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Thu, 14 Nov 2019 15:08:14 -0600 Subject: Qt UI: Use strnlen since we know the safe max --- ui/qt5/horizonwizard.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/qt5/horizonwizard.cc') diff --git a/ui/qt5/horizonwizard.cc b/ui/qt5/horizonwizard.cc index d761db1..72ede4f 100644 --- a/ui/qt5/horizonwizard.cc +++ b/ui/qt5/horizonwizard.cc @@ -119,7 +119,7 @@ std::map probe_ifaces(void) { int my_sock = ::socket(AF_INET, SOCK_STREAM, 0); if(my_sock != -1) { memset(&request, 0, sizeof(request)); - memcpy(&request.ifr_name, cifname, strlen(cifname)); + memcpy(&request.ifr_name, cifname, strnlen(cifname, IFNAMSIZ)); errno = 0; if(ioctl(my_sock, SIOCGIFHWADDR, &request) != -1) { char *buf; -- cgit v1.2.3-60-g2f50