From cd63d287dfcbf4db5af37c5346037f44c782d217 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 13 Mar 2006 06:57:11 +0000 Subject: r14307: fixed dereference of my_address->addr when NULL (This used to be commit e017246f1052f3344b90500e04c73277923baa20) --- source4/lib/socket/socket_unix.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source4') 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; } -- cgit