mirror of
https://github.com/status-im/miniupnp.git
synced 2025-02-18 00:46:30 +00:00
make sure no unitialized memory is accessed in the sockaddr_un structure
This commit is contained in:
parent
c8b42602a2
commit
8c9ce4dbb4
@ -3,7 +3,7 @@
|
|||||||
* Project : miniupnp
|
* Project : miniupnp
|
||||||
* Web : http://miniupnp.free.fr/
|
* Web : http://miniupnp.free.fr/
|
||||||
* Author : Thomas BERNARD
|
* Author : Thomas BERNARD
|
||||||
* copyright (c) 2005-2016 Thomas Bernard
|
* copyright (c) 2005-2017 Thomas Bernard
|
||||||
* This software is subjet to the conditions detailed in the
|
* This software is subjet to the conditions detailed in the
|
||||||
* provided LICENCE file. */
|
* provided LICENCE file. */
|
||||||
/*#include <syslog.h>*/
|
/*#include <syslog.h>*/
|
||||||
@ -201,6 +201,7 @@ connectToMiniSSDPD(const char * socketpath)
|
|||||||
#endif /* #ifdef MINIUPNPC_SET_SOCKET_TIMEOUT */
|
#endif /* #ifdef MINIUPNPC_SET_SOCKET_TIMEOUT */
|
||||||
if(!socketpath)
|
if(!socketpath)
|
||||||
socketpath = "/var/run/minissdpd.sock";
|
socketpath = "/var/run/minissdpd.sock";
|
||||||
|
memset(&addr, 0, sizeof(addr));
|
||||||
addr.sun_family = AF_UNIX;
|
addr.sun_family = AF_UNIX;
|
||||||
strncpy(addr.sun_path, socketpath, sizeof(addr.sun_path));
|
strncpy(addr.sun_path, socketpath, sizeof(addr.sun_path));
|
||||||
/* TODO : check if we need to handle the EINTR */
|
/* TODO : check if we need to handle the EINTR */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user