diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-03-13 06:57:11 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2006-03-13 06:57:11 +0000 |
commit | fec1a0a2b3ccad01c1f281243b960ae0350f51ea (patch) | |
tree | 71559325060c412c4a561e066cf2600193574f58 /source/lib/socket/socket_unix.c | |
parent | 6cfd11d92a851ab672fd47173c91455e79853585 (diff) | |
download | samba-fec1a0a2b3ccad01c1f281243b960ae0350f51ea.tar.gz samba-fec1a0a2b3ccad01c1f281243b960ae0350f51ea.tar.xz samba-fec1a0a2b3ccad01c1f281243b960ae0350f51ea.zip |
r14307: fixed dereference of my_address->addr when NULL
Diffstat (limited to 'source/lib/socket/socket_unix.c')
-rw-r--r-- | source/lib/socket/socket_unix.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/lib/socket/socket_unix.c b/source/lib/socket/socket_unix.c index 5e04ce0d4ca..3feb1bf234f 100644 --- a/source/lib/socket/socket_unix.c +++ b/source/lib/socket/socket_unix.c @@ -134,10 +134,11 @@ static NTSTATUS unixdom_listen(struct socket_context *sock, unlink(my_address->addr); } - if (my_address && my_address->sockaddr) { + if (my_address->sockaddr) { ret = bind(sock->fd, (struct sockaddr *)&my_addr, sizeof(my_addr)); + } else if (my_address->addr == NULL) { + return NT_STATUS_INVALID_PARAMETER; } else { - if (strlen(my_address->addr)+1 > sizeof(my_addr.sun_path)) { return NT_STATUS_OBJECT_PATH_INVALID; } |