Module Name:    src
Committed By:   christos
Date:           Mon Apr 15 21:00:33 UTC 2019

Modified Files:
        src/sys/netsmb: smb_conn.c

Log Message:
Prevent a NULL pointer dereference when the local endpoint is not defined.
>From Andy Nguyen, many thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/netsmb/smb_conn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netsmb/smb_conn.c
diff -u src/sys/netsmb/smb_conn.c:1.29 src/sys/netsmb/smb_conn.c:1.30
--- src/sys/netsmb/smb_conn.c:1.29	Sun Apr 29 16:27:31 2012
+++ src/sys/netsmb/smb_conn.c	Mon Apr 15 17:00:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: smb_conn.c,v 1.29 2012/04/29 20:27:31 dsl Exp $	*/
+/*	$NetBSD: smb_conn.c,v 1.30 2019/04/15 21:00:33 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smb_conn.c,v 1.29 2012/04/29 20:27:31 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smb_conn.c,v 1.30 2019/04/15 21:00:33 christos Exp $");
 
 /*
  * Connection engine.
@@ -553,7 +553,8 @@ smb_vc_create(struct smb_vcspec *vcspec,
 	if ((vcp->vc_paddr = dup_sockaddr(vcspec->sap, 1)) == NULL)
 		goto fail;
 
-	if ((vcp->vc_laddr = dup_sockaddr(vcspec->lap, 1)) == NULL)
+	if (vcspec->lap && 
+	    (vcp->vc_laddr = dup_sockaddr(vcspec->lap, 1)) == NULL)
 		goto fail;
 
 	if ((vcp->vc_pass = smb_strdup(vcspec->pass)) == NULL)

Reply via email to