On Thu Apr 13 11:57:27 2023 +0000, Nikolay Sivov wrote:
I was thinking of having some helper that would validate guid index, and another one for string index (unrelated to your fix). There is no need to pass in number of entries, it's fine to use what's in the header. Then we'd call for index validation for all sections, it's possible there are more issues like what you've found.
Today I tried writing generic tests to check any section header for consistency. The problem I ran into is that Windows is not consistent about where it puts blocks of data in the sections. Sometimes the blocks are not contiguous and sometimes they are out of order compared to the index. It would seem that the exact layout is unimportant.
My preference would be to fix the obviously broken code now and worry about adding tests later. If the one-line fix cannot be accepted into mainline Wine without more tests, let's put it in Wine Staging until better tests are written.