Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netsmb Prevent a NULL pointer dereference when the local...



details:   https://anonhg.NetBSD.org/src/rev/81b60f09306a
branches:  trunk
changeset: 450480:81b60f09306a
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Apr 15 21:00:33 2019 +0000

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

diffstat:

 sys/netsmb/smb_conn.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 4e2dccc1463e -r 81b60f09306a sys/netsmb/smb_conn.c
--- a/sys/netsmb/smb_conn.c     Mon Apr 15 20:51:46 2019 +0000
+++ b/sys/netsmb/smb_conn.c     Mon Apr 15 21:00:33 2019 +0000
@@ -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 @@
        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)



Home | Main Index | Thread Index | Old Index