summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-03-13 06:57:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:57:10 -0500
commitcd63d287dfcbf4db5af37c5346037f44c782d217 (patch)
treef324cce1f3c29a23aac419f754190244f2968735
parent1693d5e50748729f8e7eae5446a6e083e03a53dd (diff)
downloadsamba-cd63d287dfcbf4db5af37c5346037f44c782d217.tar.gz
samba-cd63d287dfcbf4db5af37c5346037f44c782d217.tar.bz2
samba-cd63d287dfcbf4db5af37c5346037f44c782d217.zip
r14307: fixed dereference of my_address->addr when NULL
(This used to be commit e017246f1052f3344b90500e04c73277923baa20)
-rw-r--r--source4/lib/socket/socket_unix.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source4/lib/socket/socket_unix.c b/source4/lib/socket/socket_unix.c
index 5e04ce0d4c..3feb1bf234 100644
--- a/source4/lib/socket/socket_unix.c
+++ b/source4/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;
}