summaryrefslogtreecommitdiff
path: root/ui/qt5
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-14 15:08:14 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-14 15:08:14 -0600
commitff8d9e8fcecc3cc8ace64b6cdeafdb11cf9854f3 (patch)
tree1ebdc1d6eebbc63d6f089f46b9df0a52b792646e /ui/qt5
parent7a73cba7ed274cc9f7b06ae1072bc4d790fbcb1d (diff)
downloadhorizon-ff8d9e8fcecc3cc8ace64b6cdeafdb11cf9854f3.tar.gz
horizon-ff8d9e8fcecc3cc8ace64b6cdeafdb11cf9854f3.tar.bz2
horizon-ff8d9e8fcecc3cc8ace64b6cdeafdb11cf9854f3.tar.xz
horizon-ff8d9e8fcecc3cc8ace64b6cdeafdb11cf9854f3.zip
Qt UI: Use strnlen since we know the safe max
Diffstat (limited to 'ui/qt5')
-rw-r--r--ui/qt5/horizonwizard.cc2
1 files changed, 1 insertions, 1 deletions
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<std::string, HorizonWizard::NetworkInterface> 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;