30 Sep
2022
30 Sep
'22
9:37 p.m.
Esme Povirk (@madewokherd) commented about dlls/uiautomationcore/uia_client.c:
+ if (FAILED(hr)) + { + ERR("Failed to get element from sa1 with hr %#lx\n", hr); + return -1; + } + + idx = lbound[1] + i; + hr = SafeArrayGetElement(sa2, &idx, &val[1]); + if (FAILED(hr)) + { + ERR("Failed to get element from sa2 with hr %#lx\n", hr); + return -1; + } + + if (val[0] != val[1]) + return val[0] - val[1]; I'm not sure this actually works for a comparison function. `val` is an int, and the result is an int, so the subtraction here could overflow or underflow.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/908#note_9881