Changeset 670bbe5


Ignore:
Timestamp:
12/15/08 15:27:31 (13 years ago)
Author:
Shane Alcock <salcock@…>
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:
d4a1691
Parents:
f66a2dca
Message:
  • Fixed seg fault that occured when trace_perror is called due to a bad URI format - it then tried to print the uridata which, of course, had not been set correctly
  • Ensure that the filtered_packets field for a libtrace_t was initialised to zero when the libtrace_t is created
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    r182d043 r670bbe5  
    307307        libtrace->snaplen = 0;
    308308        libtrace->started=false;
     309        libtrace->uridata = NULL;
     310        libtrace->filtered_packets = 0;
    309311
    310312        /* parse the URI to determine what sort of event we are dealing with */
     
    14421444        va_end(va);
    14431445        if(trace->err.err_num) {
    1444                 fprintf(stderr,"%s(%s): %s\n",
    1445                                 buf,trace->uridata,trace->err.problem);
     1446                if (trace->uridata) {
     1447                        fprintf(stderr,"%s(%s): %s\n",
     1448                                        buf,trace->uridata,trace->err.problem);
     1449                } else {
     1450                        fprintf(stderr,"%s: %s\n", buf, trace->err.problem);
     1451                }
    14461452        } else {
    1447                 fprintf(stderr,"%s(%s): No error\n",
    1448                                 buf,trace->uridata);
     1453                if (trace->uridata) {
     1454                        fprintf(stderr,"%s(%s): No error\n",buf,trace->uridata);
     1455                } else {
     1456                        fprintf(stderr,"%s: No error\n");
     1457                }
    14491458        }
    14501459        trace->err.err_num = 0; /* "OK" */
Note: See TracChangeset for help on using the changeset viewer.