summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-10-30 04:54:55 +0100
committerLennart Poettering <lennart@poettering.net>2009-10-30 04:54:55 +0100
commit75f7a971db587d554fffc15801a2d8f7497a2124 (patch)
treee9d654ca5d76a292fb1b1787f45060293fab220c /src
parent168be3830ae291dd819abebec813f76151487bb3 (diff)
socket-util: allocate at least sizeof(sockaddr_storage) space
Diffstat (limited to 'src')
-rw-r--r--src/pulsecore/socket-util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pulsecore/socket-util.c b/src/pulsecore/socket-util.c
index 651779f6..0d0762dc 100644
--- a/src/pulsecore/socket-util.c
+++ b/src/pulsecore/socket-util.c
@@ -85,12 +85,11 @@ void pa_socket_peer_to_string(int fd, char *c, size_t l) {
#ifndef OS_IS_WIN32
pa_assert_se(fstat(fd, &st) == 0);
-#endif
-#ifndef OS_IS_WIN32
if (S_ISSOCK(st.st_mode)) {
#endif
union {
+ struct sockaddr_storage storage;
struct sockaddr sa;
struct sockaddr_in in;
#ifdef HAVE_IPV6
@@ -315,6 +314,7 @@ pa_bool_t pa_socket_address_is_local(const struct sockaddr *sa) {
pa_bool_t pa_socket_is_local(int fd) {
union {
+ struct sockaddr_storage storage;
struct sockaddr sa;
struct sockaddr_in in;
#ifdef HAVE_IPV6