From 403689c214dbfa649468468967be3f990bff338d Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Fri, 26 Feb 2016 14:16:23 -0500 Subject: [PATCH] Small fix for potential crash bug in UDS scanner --- udsscanwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/udsscanwindow.cpp b/udsscanwindow.cpp index 8e79734..9e0c9fc 100644 --- a/udsscanwindow.cpp +++ b/udsscanwindow.cpp @@ -121,7 +121,9 @@ void UDSScanWindow::updatedFrames(int numFrames) id = thisFrame.ID; id -= ui->spinReplyOffset->value(); //back to original ECU id - if (id == sendingFrames[currIdx].ID) + int numFrames = sendingFrames.length(); + + if (numFrames > 0 && numFrames > currIdx && id == sendingFrames[currIdx].ID) { if (thisFrame.data[1] == 0x40 + sendingFrames[currIdx].data[1]) {