[PATCH 3/8] d2d1/tests: Avoid out-of-bounds access when comparing segments

Henri Verbeet hverbeet at gmail.com
Tue Jan 11 09:47:14 CST 2022


On Tue, 11 Jan 2022 at 08:55, Stefan Brüns <stefan.bruens at rwth-aachen.de> wrote:
> On Freitag, 7. Januar 2022 18:10:05 CET you wrote:
> > On Fri, 7 Jan 2022 at 09:00, Stefan Brüns <stefan.bruens at rwth-aachen.de>
> wrote:
> > > In case real and expected segment count differ, don't compare the
> > > segment type/position for extra segments.
> >
> > Unless it's e.g. a huge help when debugging failures, I'm not sure we
> > care; if the segment counts don't match the test is going to fail, one
> > way or another.
>
> This is an invalid memory access (though read-only). This should never be
> done, even in tests.
>
That's not the position the Wine project has historically taken on
this kind of thing, at least when it comes to the tests. The basic
idea is that the test isn't supposed to fail, so when it does, we
don't particularly care about any follow-up damage. (Provided that's
limited to the test process.) I.e., think of ok() much like assert().



More information about the wine-devel mailing list