From fec1a0a2b3ccad01c1f281243b960ae0350f51ea 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 --- source/lib/socket/socket_unix.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/lib/socket/socket_unix.c') 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; } -- cgit