Source-Changes-HG archive

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

[src/trunk]: src/sys/net don't access freed memory.



details:   https://anonhg.NetBSD.org/src/rev/cef1fcbada19
branches:  trunk
changeset: 533978:cef1fcbada19
user:      yamt <yamt%NetBSD.org@localhost>
date:      Thu Jul 11 21:21:53 2002 +0000

description:
don't access freed memory.

diffstat:

 sys/net/if_spppsubr.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r e595dfb08c1c -r cef1fcbada19 sys/net/if_spppsubr.c
--- a/sys/net/if_spppsubr.c     Thu Jul 11 21:20:23 2002 +0000
+++ b/sys/net/if_spppsubr.c     Thu Jul 11 21:21:53 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_spppsubr.c,v 1.48 2002/07/06 18:33:45 itojun Exp $   */
+/*     $NetBSD: if_spppsubr.c,v 1.49 2002/07/11 21:21:53 yamt Exp $     */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.48 2002/07/06 18:33:45 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.49 2002/07/11 21:21:53 yamt Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipx.h"
@@ -733,9 +733,11 @@
                 * - we flag TCP packets with src ip 0 as an error
                 */     
                if (ip && ip->ip_src.s_addr == INADDR_ANY) {
+                       u_int8_t proto = ip->ip_p;
+
                        m_freem(m);
                        splx(s);
-                       if (ip->ip_p == IPPROTO_TCP)
+                       if (proto == IPPROTO_TCP)
                                return(EADDRNOTAVAIL);
                        else
                                return(0);



Home | Main Index | Thread Index | Old Index