diff options
author | Stefan Sperling <ssperling@sysmocom.de> | 2018-01-08 19:20:02 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-01-12 13:48:59 +0000 |
commit | 1e50e2ad4813c037b0fbc5559381ec22776225d7 (patch) | |
tree | 389ada1e65127e552ef730f6d216280826760a8d /include/osmocom/core/statistics.h | |
parent | ffad574a4b68596d17671965bf145f11f0b00e57 (diff) |
TLVP_PRESENT() should not return TRUE after tlv_parse() fails.
If the length provided in the patcket exceeds the buffer length,
tlv_parse() returns -2 but leaves tlv.val and tlv.len initializd.
Many callers of tlv_parse() do not check its return value, but
rely on TLVP_PRESENT() to see if a particular TLV was parsed
successfully. By clearing tlv.val and tlv.len we make it less
likely that those callers will use an overlong TLV length value.
Change-Id: I4dda6938e1650b4bcaac45809a4763f86f5a9794
Diffstat (limited to 'include/osmocom/core/statistics.h')
0 files changed, 0 insertions, 0 deletions