Changeset 797e9a8 in rtems


Ignore:
Timestamp:
10/08/14 09:43:10 (9 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.9
Children:
ca30866
Parents:
b6519e4b
git-author:
Sebastian Huber <sebastian.huber@…> (10/08/14 09:43:10)
git-committer:
Gedare Bloom <gedare@…> (11/22/14 14:32: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

    rb6519e4b r797e9a8  
    705705    if ( m == NULL ) {
    706706      /* get mbuf header */
    707       MGETHDR(m, M_DONTWAIT, MT_DATA);
    708       if ( m == NULL ) {
    709         /* error - set condition to break out */
    710         printf("pppallocmbuf: MGETHDR failed\n");
    711         break;
    712       }
    713       MCLGET(m, M_DONTWAIT);
    714       m->m_next = NULL;
     707      MGETHDR(m, M_WAIT, MT_DATA);
     708      MCLGET(m, M_WAIT);
    715709      *mp = m;
    716710    }
Note: See TracChangeset for help on using the changeset viewer.