mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-17 17:02:51 +08:00
LoadCachedBook reads each index entry's parent back-reference straight from the .cached file and uses it as an index with no check, so a crafted cached file (which can sit inside a .htb help archive opened through AddBook) may result in creating a pointer to data outside the m_index array; that pointer is later dereferenced when the index is sorted at the end of AddBookParam. The change rejects the file when parentShift is negative or larger than the number of index entries loaded so far, matching the existing version and flags checks just above. Also add a small test under tests/html that feeds such a cached stream and confirms it is now refused rather than reading out of bounds. Closes #26577.
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.