Changeset d8fc342 for lib/protocols.c


Ignore:
Timestamp:
04/11/06 16:48:35 (16 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
6b0560b
Parents:
9e46ee7
Message:

Don't segfault if you ask for a port on something which has no transport
header

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/protocols.c

    r9e46ee7 rd8fc342  
    479479                        NULL, NULL);
    480480
    481         return ntohs(port->src);
     481        if (port)
     482                return ntohs(port->src);
     483        else
     484                return 0;
    482485}
    483486
     
    489492                        NULL, NULL);
    490493
    491         return ntohs(port->dst);
     494        if (port)
     495                return ntohs(port->dst);
     496        else
     497                return 0;
    492498}
    493499
Note: See TracChangeset for help on using the changeset viewer.