Changeset 3e1bf78 in rtems


Ignore:
Timestamp:
10/08/14 09:43:10 (9 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
1d3025b5
Parents:
22cd282
git-author:
Sebastian Huber <sebastian.huber@…> (10/08/14 09:43:10)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/08/14 09:55:15)
Message:

ppp: PR1943: Avoid NULL pointer access

Waiting for mbufs at this level is a bad solution. It would be better
to try to allocate a new mbuf chain before we hand over the current mbuf
chain to the upper layer. In case the allocation fails we should drop
the current packet and use its mbuf chain for a new packet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libnetworking/net/ppp_tty.c

    r22cd282 r3e1bf78  
    717717    if ( m == NULL ) {
    718718      /* get mbuf header */
    719       MGETHDR(m, M_DONTWAIT, MT_DATA);
    720       if ( m == NULL ) {
    721         /* error - set condition to break out */
    722         printf("pppallocmbuf: MGETHDR failed\n");
    723         break;
    724       }
    725       MCLGET(m, M_DONTWAIT);
    726       m->m_next = NULL;
     719      MGETHDR(m, M_WAIT, MT_DATA);
     720      MCLGET(m, M_WAIT);
    727721      *mp = m;
    728722    }
Note: See TracChangeset for help on using the changeset viewer.