Commit 34fdfb48 authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Guard against negative value

parent 1d5e8683
Pipeline #128604 passed with stage
in 2 minutes and 4 seconds
......@@ -244,7 +244,10 @@ void Emulation::receiveData(const char *text, int length)
// this check into the above for loop?
auto *found = static_cast<const char *>(memchr(text, '\030', length));
if (found) {
int startPos = text - found;
auto startPos = text - found;
if (startPos < 0) {
return;
}
for (int i = startPos; i < length - 4; i++) {
if (text[i] == '\030') {
if (qstrncmp(text + i + 1, "B00", 3) == 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment