1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-21 20:38:45 +00:00

Fix wpa_cli. You need to pass all of the sockaddr, not just part of it.

Also be sure to keep the path null terminated as Stevens does.

While I'm here, take maintainership since I use this and seem to be
making most of the recent commits.
This commit is contained in:
Brooks Davis 2005-04-23 03:29:45 +00:00
parent fcd2aa8e44
commit ed96a0df08
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=133980
2 changed files with 29 additions and 1 deletions

View File

@ -7,10 +7,11 @@
PORTNAME= wpa_supplicant
PORTVERSION= 0.3.8
PORTREVISION= 1
CATEGORIES= security net
MASTER_SITES= http://hostap.epitest.fi/releases/
MAINTAINER= ports@FreeBSD.org
MAINTAINER= brooks@FreeBSD.org
COMMENT= Supplicant (client) for WPA/802.1x protocols
USE_REINPLACE= yes

View File

@ -0,0 +1,27 @@
$FreeBSD$
--- wpa_ctrl.c.orig
+++ wpa_ctrl.c
@@ -88,7 +88,7 @@
}
ctrl->local.sun_family = AF_UNIX;
- snprintf(ctrl->local.sun_path, sizeof(ctrl->local.sun_path),
+ snprintf(ctrl->local.sun_path, sizeof(ctrl->local.sun_path) - 1,
"/tmp/wpa_ctrl_%d-%d", getpid(), counter++);
if (bind(ctrl->s, (struct sockaddr *) &ctrl->local,
sizeof(ctrl->local.sun_family) +
@@ -99,10 +99,9 @@
}
ctrl->dest.sun_family = AF_UNIX;
- strncpy(ctrl->dest.sun_path, ctrl_path, sizeof(ctrl->dest.sun_path));
+ strncpy(ctrl->dest.sun_path, ctrl_path, sizeof(ctrl->dest.sun_path) - 1);
if (connect(ctrl->s, (struct sockaddr *) &ctrl->dest,
- sizeof(ctrl->dest.sun_family) +
- strlen(ctrl->dest.sun_path)) < 0) {
+ sizeof(ctrl->dest)) < 0) {
close(ctrl->s);
unlink(ctrl->local.sun_path);
free(ctrl);