diff --git a/changes.txt b/changes.txt index 5648e35..fb7e597 100644 --- a/changes.txt +++ b/changes.txt @@ -374,6 +374,7 @@ Changes in 1.9 (not yet released) -------------------------- Changes in 1.8.6 +- Avoid warning about stringop-overflow in string::subString when compiling in release with newer gcc - Update library zlib to 1.2.11 (from 1.2.8) - Update library bzip2 to 1.0.8 (from 1.0.6) - Security: Fix buffer overflow caused by malformed md2 files. Thanks @procfs for reporting (https://irrlicht.sourceforge.io/forum/viewtopic.php?f=7&t=52785) diff --git a/examples/04.Movement/main.cpp b/examples/04.Movement/main.cpp index e7d3777..6a3c94b 100644 --- a/examples/04.Movement/main.cpp +++ b/examples/04.Movement/main.cpp @@ -42,7 +42,7 @@ public: /* Always return false by default. If you return true you tell the engine that you handled this event completely and the Irrlicht should not - process it any further. So for example if you return true for all + process it any further. So for example if you return true for all EET_KEY_INPUT_EVENT events then Irrlicht would not pass on key-events to it's GUI system. */ @@ -54,7 +54,7 @@ public: { return KeyIsDown[keyCode]; } - + MyEventReceiver() { for (u32 i=0; i(10,20)); /* - Lets draw the scene and also write the current frames per second and the + Lets draw the scene and also write the current frames per second and the name of the driver to the caption of the window. */ int lastFPS = -1; @@ -259,7 +259,7 @@ int main() In the end, delete the Irrlicht device. */ device->drop(); - + return 0; } diff --git a/include/irrString.h b/include/irrString.h index 021086f..bc7a6a2 100644 --- a/include/irrString.h +++ b/include/irrString.h @@ -947,13 +947,13 @@ public: \param make_lower copy only lower case */ string subString(u32 begin, s32 length, bool make_lower = false ) const { + // clamp length to maximal value + if ((length+begin) > size()) + length = size()-begin; // if start after string // or no proper substring length if ((length <= 0) || (begin>=size())) return string(""); - // clamp length to maximal value - if ((length+begin) > size()) - length = size()-begin; string o; o.reserve(length+1); diff --git a/tests/tests-last-passed-at.txt b/tests/tests-last-passed-at.txt index 3cde178..fde0c2e 100644 --- a/tests/tests-last-passed-at.txt +++ b/tests/tests-last-passed-at.txt @@ -1,4 +1,4 @@ -Tests finished. 72 tests of 72 passed. -Compiled as DEBUG -Test suite pass at GMT Sat May 14 18:16:57 2022 - +Tests finished. 72 tests of 72 passed. +Compiled as DEBUG +Test suite pass at GMT Thu Sep 15 20:10:06 2022 +