fix for variable datatype length bounds check (fixes #805)

This commit is contained in:
John
2023-01-30 22:55:46 +01:00
parent 9218a1d8e8
commit 9c0af7b95e
+1 -1
View File
@@ -465,7 +465,7 @@ result_t Message::create(const string& filename, const DataFieldTemplates* templ
return result;
}
}
if (id.size() + data->getLength(pt_masterData, maxLength) > 2 + maxLength
if (id.size() + data->getLength(pt_masterData, maxLength==MAX_POS ? MAX_POS-id.size() : maxLength) > 2 + maxLength
|| data->getLength(pt_slaveData, maxLength) > maxLength) {
// max NN exceeded
delete data;