diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-12-23 09:20:10 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-12-23 09:20:10 -0800 |
commit | 96afbce6fc40e89e4f215db5838ae00979185e11 (patch) | |
tree | c49ac504a636ac7ff62bd8ce7321d460994dd195 /print-ospf.c | |
parent | 21aff56b3956bb0d09632cdaf625033f70a1a445 (diff) | |
download | tcpdump-96afbce6fc40e89e4f215db5838ae00979185e11.tar.gz |
Make 1-element arrays for fields that may repeat.
For various opaque LSAs, not only is the value of the TLV a "may
repeat", the TLVs *themselves* may repeat.
Also, pass a pointer to the TLV to ospf_print_grace_lsa() and
ospf_print_te_lsa(), rather than a pointer to the type field, as they
dissect a sequence of TLVs.
Hopefully, that will address Coverity CID 1426916, 1426917, and 1426920.
Diffstat (limited to 'print-ospf.c')
-rw-r--r-- | print-ospf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/print-ospf.c b/print-ospf.c index 113ecde6..921bed0c 100644 --- a/print-ospf.c +++ b/print-ospf.c @@ -804,7 +804,7 @@ ospf_print_lsa(netdissect_options *ndo, switch (EXTRACT_U_1(lsap->ls_hdr.un_lsa_id.opaque_field.opaque_type)) { case LS_OPAQUE_TYPE_RI: - tptr = (const uint8_t *)(&lsap->lsa_un.un_ri_tlv.type); + tptr = (const uint8_t *)(lsap->lsa_un.un_ri_tlv); while (ls_length != 0) { ND_TCHECK_4(tptr); @@ -852,14 +852,14 @@ ospf_print_lsa(netdissect_options *ndo, break; case LS_OPAQUE_TYPE_GRACE: - if (ospf_print_grace_lsa(ndo, (const uint8_t *)(&lsap->lsa_un.un_grace_tlv.type), + if (ospf_print_grace_lsa(ndo, (const uint8_t *)(lsap->lsa_un.un_grace_tlv), ls_length) == -1) { return(ls_end); } break; case LS_OPAQUE_TYPE_TE: - if (ospf_print_te_lsa(ndo, (const uint8_t *)(&lsap->lsa_un.un_te_lsa_tlv.type), + if (ospf_print_te_lsa(ndo, (const uint8_t *)(lsap->lsa_un.un_te_lsa_tlv), ls_length) == -1) { return(ls_end); } |