When ilv_valid() returns a non-zero in sdatailv_print(), the amount of
bytes declared remaining may be insufficient to contain a complete
header, let alone any data. Thus do not try to hex dump the data,
instead print an error message and be done with it.
This fixes an inconsistency discovered by Francois-Xavier.
const u_char *tdp = (const u_char *) ILV_DATA(ilv);
invilv = ilv_valid(ndo, ilv, rlen);
if (invilv) {
- ND_PRINT("%s[", ib + 1);
- hex_print(ndo, ib, tdp, rlen);
- ND_PRINT("\n%s]\n", ib + 1);
+ ND_PRINT("Error: %s, rlen %u\n",
+ tok2str(ForCES_TLV_err, NULL, invilv), rlen);
goto invalid;
}
if (ndo->ndo_vflag >= 3) {