mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-18 01:19:45 +08:00
Avoid integer overflow in message catalog StringAtOfs() bounds check: StringAtOfs() read ofsString and nLen from the .mo file and checked ofsString + nLen against the data length, but both are 32-bit so the sum wraps and a translated entry declaring nLen 0xffffffff passes the check; FillHash() then scans past the end of the catalog. Compute the offset as a 64-bit value so the addition can't overflow and result in an invalid index into the buffer. Add a test feeding such a catalog through wxMsgCatalog::CreateFromData(). Closes #26513.
Tests
This directory contains tests for the library and is mostly useful for the
library developers. See the samples subdirectory for the examples that are
more useful to the application developers using the library.
If you do work on the library itself and would like to modify an existing or
add a new test, please see docs/contributing/how-to-write-unit-tests.md for
more information.
This file also contains the instructions for running the tests if you'd just like to do it to confirm that the library works correctly.