You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function "newFile" in the FileRead class is accessing a position outside of the "checkArray" length, which may result in accessing a protected memory region (Segmentation fault).
The issue is the maximum value of 'i' is 32 but the checkArray in that case is 23:
// Segmentation faultfor(int i = 0; i < 32; i++){
if (tmp == checkArray[i]) {
_resultArray[i] = value;
}
}
The function "newFile" in the FileRead class is accessing a position outside of the "checkArray" length, which may result in accessing a protected memory region (Segmentation fault).
The issue is the maximum value of 'i' is 32 but the checkArray in that case is 23:
I think a simple fix can be like this:
Each time you call the 'newFile' function, it will free the old memory if it exists and allocates a new one to store the results.
The text was updated successfully, but these errors were encountered: