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/c19a3b62e664
branches:  trunk
changeset: 533981:c19a3b62e664
user:      yamt <yamt%NetBSD.org@localhost>
date:      Thu Jul 11 21:37:51 2002 +0000

description:
don't access freed memory.

diffstat:

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

diffs (53 lines):

diff -r c22d45b8e9cf -r c19a3b62e664 sys/net/if_spppsubr.c
--- a/sys/net/if_spppsubr.c     Thu Jul 11 21:23:30 2002 +0000
+++ b/sys/net/if_spppsubr.c     Thu Jul 11 21:37:51 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_spppsubr.c,v 1.49 2002/07/11 21:21:53 yamt Exp $     */
+/*     $NetBSD: if_spppsubr.c,v 1.50 2002/07/11 21:37:51 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.49 2002/07/11 21:21:53 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.50 2002/07/11 21:37:51 yamt Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipx.h"
@@ -888,7 +888,8 @@
                        if (rv == 0)
                                rv = ENOBUFS;
                }
-               IF_ENQUEUE(ifq, m);
+               else
+                       IF_ENQUEUE(ifq, m);
        } else
                IFQ_ENQUEUE(&ifp->if_snd, m, &pktattr, rv);
        if (rv != 0) {
@@ -1286,6 +1287,8 @@
                IF_DROP (&sp->pp_fastq);
                IF_DROP (&ifp->if_snd);
                m_freem (m);
+               ++ifp->if_oerrors;
+               return;
        } else
                IF_ENQUEUE (&sp->pp_cpq, m);
        if (! (ifp->if_flags & IFF_OACTIVE))
@@ -1351,6 +1354,7 @@
                IF_DROP (&ifp->if_snd);
                m_freem (m);
                ++ifp->if_oerrors;
+               return;
        } else
                IF_ENQUEUE (&sp->pp_cpq, m);
        if (! (ifp->if_flags & IFF_OACTIVE))
@@ -4583,6 +4587,7 @@
                IF_DROP (&ifp->if_snd);
                m_freem (m);
                ++ifp->if_oerrors;
+               return;
        } else
                IF_ENQUEUE (&sp->pp_cpq, m);
        if (! (ifp->if_flags & IFF_OACTIVE))



Home | Main Index | Thread Index | Old Index