Fix TopicTree OOM while fuzzing

This commit is contained in:
Alex Hultman
2021-02-22 21:35:53 +01:00
parent 8dc4699b7b
commit cdc74aaddb
+6
View File
@@ -45,6 +45,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
/* Then one byte action */
if (data[4] == 'S') {
/* Some ridiculously long topics has to be cut short (OOM) */
if (lastString.length() > 512) {
lastString = "too long!";
}
/* Subscribe */
if (subscribers.find(id) == subscribers.end()) {