Source-Changes-HG archive

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

[src/trunk]: src/sys/netsmb Set 'ntencpass' to NULL as part of 'again', to pr...



details:   https://anonhg.NetBSD.org/src/rev/98c156e1da7a
branches:  trunk
changeset: 968214:98c156e1da7a
user:      maxv <maxv%NetBSD.org@localhost>
date:      Tue Jan 07 06:14:42 2020 +0000

description:
Set 'ntencpass' to NULL as part of 'again', to prevent use-after-free.

diffstat:

 sys/netsmb/smb_smb.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 48a92ed685f0 -r 98c156e1da7a sys/netsmb/smb_smb.c
--- a/sys/netsmb/smb_smb.c      Tue Jan 07 06:12:09 2020 +0000
+++ b/sys/netsmb/smb_smb.c      Tue Jan 07 06:14:42 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: smb_smb.c,v 1.34 2018/09/03 16:29:36 riastradh Exp $   */
+/*     $NetBSD: smb_smb.c,v 1.35 2020/01/07 06:14:42 maxv Exp $        */
 
 /*
  * Copyright (c) 2000-2001 Boris Popov
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smb_smb.c,v 1.34 2018/09/03 16:29:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smb_smb.c,v 1.35 2020/01/07 06:14:42 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -262,7 +262,7 @@
        struct smb_rq *rqp;
        struct mbchain *mbp;
        const smb_unichar *unipp;
-       smb_uniptr ntencpass = NULL;
+       smb_uniptr ntencpass;
        char *up, *pbuf, *encpass;
        const char *pp;
        int error, plen, uniplen, ulen, upper;
@@ -272,7 +272,7 @@
        upper = 0;
 
 again:
-
+       ntencpass = NULL;
        vcp->vc_smbuid = SMB_UID_UNKNOWN;
 
        error = smb_rq_alloc(VCTOCP(vcp), SMB_COM_SESSION_SETUP_ANDX, scred, &rqp);



Home | Main Index | Thread Index | Old Index