Changeset 1de522d


Ignore:
Timestamp:
11/14/17 17:20:06 (3 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
cachetimestamps, develop, dpdk-ndag, etsilive, master, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance
Children:
ccef50c
Parents:
e8db2d4
Message:

Fix maybe uninitialised warnings in OSPF libpacketdump decoders.

Location:
libpacketdump
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libpacketdump/ospf2_1001.c

    ree6e802 r1de522d  
    3333DLLEXPORT void decode(int link_type UNUSED,const char *packet,unsigned len) {
    3434        unsigned char *link_ptr = NULL;
    35         libtrace_ospf_link_v2_t *link;
     35        libtrace_ospf_link_v2_t *link = NULL;
    3636        uint32_t link_len;
    3737        libtrace_ospf_router_lsa_v2_t *hdr;
     
    5858                return;
    5959        while (trace_get_next_ospf_link_v2(&link_ptr, &link, &len, &link_len) > 0) {
     60                if (!link) {
     61                        break;
     62                }
    6063                printf(" OSPF Router Link: Id %s ", inet_ntoa(link->link_id));
    6164                printf("Data %s\n", inet_ntoa(link->link_data));
  • libpacketdump/ospf2_4.c

    ree6e802 r1de522d  
    3434DLLEXPORT void decode(int link_type UNUSED,const char *packet,unsigned len) {
    3535        libtrace_ospf_ls_update_t *update = (libtrace_ospf_ls_update_t *)packet;
    36         unsigned char *lsa_ptr;
    37         uint8_t lsa_type;
    38         libtrace_ospf_lsa_v2_t *lsa_hdr;
    39         unsigned char *lsa_body;
     36        unsigned char *lsa_ptr = NULL;
     37        uint8_t lsa_type = 0;
     38        libtrace_ospf_lsa_v2_t *lsa_hdr = NULL;
     39        unsigned char *lsa_body = NULL;
    4040        int i = 0;
    4141        int max_lsas = 0;
    4242        uint32_t rem = len;
    43         uint16_t lsa_length;
     43        uint16_t lsa_length = 0;
    4444
    4545
Note: See TracChangeset for help on using the changeset viewer.