Skip to content

Commit

Permalink
Fix get_group_ifname() buffer use
Browse files Browse the repository at this point in the history
If the group interface is fetched from the INTERFACES command, a pointer
to the local stack buffer was returned. This is not valid outside the
get_group_ifname() function, so use a static buffer to avoid such
issues.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
  • Loading branch information
jmalinen committed Aug 29, 2016
1 parent 0a05d50 commit 326123a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion p2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ static struct wfa_cs_p2p_group * p2p_group_get(struct sigma_dut *dut,

static const char * get_group_ifname(struct sigma_dut *dut, const char *ifname)
{
char buf[1000], *iface, *pos;
static char buf[1000];
char *iface, *pos;
char state[100];

if (dut->groups) {
Expand Down

0 comments on commit 326123a

Please sign in to comment.