summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/edi/common.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/edi/common.cpp b/lib/edi/common.cpp
index 134e14b..c892425 100644
--- a/lib/edi/common.cpp
+++ b/lib/edi/common.cpp
@@ -310,15 +310,17 @@ bool TagDispatcher::decode_tagpacket(const vector<uint8_t> &payload)
uint32_t taglength = read_32b(payload.begin() + i + 4);
if (taglength % 8 != 0) {
- etiLog.log(warn, "Invalid tag length: not multiple of 8!");
+ etiLog.log(warn, "Invalid EDI tag length, not multiple of 8!");
break;
}
taglength /= 8;
length = taglength;
- if (i + 8 + taglength >= payload.size()) {
- etiLog.log(warn, "Invalid tag length: tag larger than tagpacket!");
+ const size_t calculated_length = i + 8 + taglength;
+ if (calculated_length > payload.size()) {
+ etiLog.log(warn, "Invalid EDI tag length: tag larger %zu than tagpacket %zu!",
+ calculated_length, payload.size());
break;
}