summaryrefslogtreecommitdiff
path: root/ospf.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-12-23 09:20:10 -0800
committerGuy Harris <guy@alum.mit.edu>2017-12-23 09:20:10 -0800
commit96afbce6fc40e89e4f215db5838ae00979185e11 (patch)
treec49ac504a636ac7ff62bd8ce7321d460994dd195 /ospf.h
parent21aff56b3956bb0d09632cdaf625033f70a1a445 (diff)
downloadtcpdump-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 'ospf.h')
-rw-r--r--ospf.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/ospf.h b/ospf.h
index 4dca0af3..ae7d2f94 100644
--- a/ospf.h
+++ b/ospf.h
@@ -230,21 +230,21 @@ struct lsa {
nd_uint16_t type;
nd_uint16_t length;
nd_byte data[1]; /* may repeat */
- } un_te_lsa_tlv;
+ } un_te_lsa_tlv[1]; /* may repeat */
/* Opaque Grace LSA */
struct {
nd_uint16_t type;
nd_uint16_t length;
nd_byte data[1]; /* may repeat */
- } un_grace_tlv;
+ } un_grace_tlv[1]; /* may repeat */
/* Opaque Router information LSA */
struct {
nd_uint16_t type;
nd_uint16_t length;
nd_byte data[1]; /* may repeat */
- } un_ri_tlv;
+ } un_ri_tlv[1]; /* may repeat */
/* Unknown LSA */
struct unknown {