Piotr Caban (@piotr) commented about dlls/msvcirt/tests/msvcirt.c:
ok(ssb2.base.pptr == ssb2.base.base + 1, "wrong put pointer, expected %p got %p\n", ssb2.base.base + 1, ssb2.base.pptr); ok(ssb2.base.epptr == ssb2.base.base + 16, "wrong put end, expected %p got %p\n", ssb2.base.base + 16, ssb2.base.epptr); ok(*(ssb2.base.pptr - 1) == 'D', "expected 'D' got %d\n", *(ssb2.base.pptr - 1)); + /* test strstreambuf_overflow always allocate in `increase` increments, even when the new size + * won't be large enough to contain `pptr`. `custom_alloc` allocate more space than asked for + * to avoid out-of-bound access. */ ssb2.base.pbase = ssb2.base.base + 3; ssb2.base.pptr = ssb2.base.epptr + 5; + ssb2.f_alloc = custom_alloc; ret = (int) call_func2(p_strstreambuf_overflow, &ssb2, 'E');
Can we change the test to call strstreambuf_doallocate instead? I think it would be cleaner this way. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8297#note_106499