Changeset d1d31a5f in rtems


Ignore:
Timestamp:
Oct 8, 2014, 9:43:10 AM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.10
Children:
0444c031
Parents:
b47dffc
git-author:
Sebastian Huber <sebastian.huber@…> (10/08/14 09:43:10)
git-committer:
Gedare Bloom <gedare@…> (11/22/14 14:33:12)
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

    rb47dffc rd1d31a5f  
    709709    if ( m == NULL ) {
    710710      /* get mbuf header */
    711       MGETHDR(m, M_DONTWAIT, MT_DATA);
    712       if ( m == NULL ) {
    713         /* error - set condition to break out */
    714         printf("pppallocmbuf: MGETHDR failed\n");
    715         break;
    716       }
    717       MCLGET(m, M_DONTWAIT);
    718       m->m_next = NULL;
     711      MGETHDR(m, M_WAIT, MT_DATA);
     712      MCLGET(m, M_WAIT);
    719713      *mp = m;
    720714    }
Note: See TracChangeset for help on using the changeset viewer.