Remove ND_TCHECK_SIZE() immediately before two GET_BE_U_2() calls that
together fully cover a struct forces_tlv.
Ditto before two GET_BE_U_4() calls and a struct forces_ilv.
Remove ND_TCHECK_SIZE() immediately before ilv_valid(), which always
checks that forces_ilv->length is within bounds, which implies that
forces_ilv->type is also within bounds, which means the whole 8-byte
structure is within bounds.
Ditto before GET_BE_U_2() on the length field of a struct forces_tlv.
#endif
char *ib = indent_pr(indent, 1);
const u_char *tdp = (const u_char *) ILV_DATA(ilv);
#endif
char *ib = indent_pr(indent, 1);
const u_char *tdp = (const u_char *) ILV_DATA(ilv);
invilv = ilv_valid(ndo, ilv, rlen);
if (invilv) {
ND_PRINT("%s[", ib + 1);
invilv = ilv_valid(ndo, ilv, rlen);
if (invilv) {
ND_PRINT("%s[", ib + 1);
-
-trunc:
- nd_print_trunc(ndo);
- return -1;
uint16_t type, tll;
u_int invtlv;
uint16_t type, tll;
u_int invtlv;
id = GET_BE_U_4(tdp);
ND_PRINT("%sKeyinfo: Key 0x%x\n", ib, id);
id = GET_BE_U_4(tdp);
ND_PRINT("%sKeyinfo: Key 0x%x\n", ib, id);
type = GET_BE_U_2(kdtlv->type);
tll = GET_BE_U_2(kdtlv->length);
invtlv = tlv_valid(tll, len);
type = GET_BE_U_2(kdtlv->type);
tll = GET_BE_U_2(kdtlv->length);
invtlv = tlv_valid(tll, len);
tll = GET_BE_U_2(kdtlv->length);
dp = (const u_char *) TLV_DATA(kdtlv);
return fdatatlv_print(ndo, dp, tll, op_msk, indent);
tll = GET_BE_U_2(kdtlv->length);
dp = (const u_char *) TLV_DATA(kdtlv);
return fdatatlv_print(ndo, dp, tll, op_msk, indent);
-
-trunc:
- nd_print_trunc(ndo);
- return -1;
}
#define PTH_DESC_SIZE 12
}
#define PTH_DESC_SIZE 12
type = GET_BE_U_2(pdtlv->type);
tlvl = GET_BE_U_2(pdtlv->length);
invtlv = tlv_valid(tlvl, len);
type = GET_BE_U_2(pdtlv->type);
tlvl = GET_BE_U_2(pdtlv->length);
invtlv = tlv_valid(tlvl, len);
u_int invtlv;
char *ib = indent_pr(indent, 0);
u_int invtlv;
char *ib = indent_pr(indent, 0);
type = GET_BE_U_2(pdtlv->type);
tlvl = GET_BE_U_2(pdtlv->length);
invtlv = tlv_valid(tlvl, len);
type = GET_BE_U_2(pdtlv->type);
tlvl = GET_BE_U_2(pdtlv->length);
invtlv = tlv_valid(tlvl, len);
ND_PRINT("\t\t\tInvalid ForCES TLV type=%x", type);
return -1;
}
ND_PRINT("\t\t\tInvalid ForCES TLV type=%x", type);
return -1;
}
-
-trunc:
- nd_print_trunc(ndo);
- return -1;
char *ib;
const u_char *dp;
char *ib;
const u_char *dp;
tlvl = GET_BE_U_2(pdtlv->length);
invtlv = tlv_valid(tlvl, len);
if (invtlv) {
tlvl = GET_BE_U_2(pdtlv->length);
invtlv = tlv_valid(tlvl, len);
if (invtlv) {
-
-trunc:
- nd_print_trunc(ndo);
- return -1;
* lfbselect_print() has ensured that GET_BE_U_2(otlv->length)
* >= TLV_HDRL.
*/
* lfbselect_print() has ensured that GET_BE_U_2(otlv->length)
* >= TLV_HDRL.
*/
type = GET_BE_U_2(otlv->type);
tll = GET_BE_U_2(otlv->length) - TLV_HDRL;
ops = get_forces_optlv_h(type);
type = GET_BE_U_2(otlv->type);
tll = GET_BE_U_2(otlv->length) - TLV_HDRL;
ops = get_forces_optlv_h(type);
rc = ops->print(ndo, dp, tll, ops->op_msk, indent + 1);
}
return rc;
rc = ops->print(ndo, dp, tll, ops->op_msk, indent + 1);
}
return rc;
-
-trunc:
- nd_print_trunc(ndo);
- return -1;
* ILV) >= ILV_HDRL.
*/
rlen = GET_BE_U_4(ilv->length) - ILV_HDRL;
* ILV) >= ILV_HDRL.
*/
rlen = GET_BE_U_4(ilv->length) - ILV_HDRL;
ND_PRINT("%sMetaID 0x%x length %u\n", ib, GET_BE_U_4(ilv->type),
GET_BE_U_4(ilv->length));
if (ndo->ndo_vflag >= 3) {
ND_PRINT("%sMetaID 0x%x length %u\n", ib, GET_BE_U_4(ilv->type),
GET_BE_U_4(ilv->length));
if (ndo->ndo_vflag >= 3) {
ND_PRINT(" ]\n");
}
return 0;
ND_PRINT(" ]\n");
}
return 0;
-
-trunc:
- nd_print_trunc(ndo);
- return -1;
rlen = dlen;
ND_PRINT("\n%s METADATA length %u\n", ib, rlen);
while (rlen != 0) {
rlen = dlen;
ND_PRINT("\n%s METADATA length %u\n", ib, rlen);
while (rlen != 0) {
invilv = ilv_valid(ndo, ilv, rlen);
if (invilv) {
break;
invilv = ilv_valid(ndo, ilv, rlen);
if (invilv) {
break;
-
-trunc:
- nd_print_trunc(ndo);
- return -1;
while (rlen != 0) {
uint16_t type, tlvl;
while (rlen != 0) {
uint16_t type, tlvl;
type = GET_BE_U_2(tlv->type);
tlvl = GET_BE_U_2(tlv->length);
invtlv = tlv_valid(tlvl, rlen);
type = GET_BE_U_2(tlv->type);
tlvl = GET_BE_U_2(tlv->length);
invtlv = tlv_valid(tlvl, rlen);
-
-trunc:
- nd_print_trunc(ndo);
- return -1;
while (rlen != 0) {
uint16_t type, tlvl;
while (rlen != 0) {
uint16_t type, tlvl;
type = GET_BE_U_2(otlv->type);
tlvl = GET_BE_U_2(otlv->length);
invtlv = tlv_valid(tlvl, rlen);
type = GET_BE_U_2(otlv->type);
tlvl = GET_BE_U_2(otlv->length);
invtlv = tlv_valid(tlvl, rlen);
while (rlen != 0) {
uint16_t type, tlvl;
while (rlen != 0) {
uint16_t type, tlvl;
type = GET_BE_U_2(tltlv->type);
tlvl = GET_BE_U_2(tltlv->length);
invtlv = tlv_valid(tlvl, rlen);
type = GET_BE_U_2(tltlv->type);
tlvl = GET_BE_U_2(tltlv->length);
invtlv = tlv_valid(tlvl, rlen);
-
-trunc:
- nd_print_trunc(ndo);
- return -1;