Esme Povirk (@madewokherd) commented about dlls/sane.ds/options.c:
+ return 0; +} + +TW_UINT16 sane_option_probe_str(const char* option_name, const WCHAR* const* filter[], char* opt_values, int buf_len) { WCHAR *p; - char buffer[256]; struct option_descriptor opt; - TW_UINT16 rc = sane_find_option("mode", TYPE_STRING, &opt); + TW_UINT16 rc = sane_find_option(option_name, TYPE_STRING, &opt);
if (rc != TWCC_SUCCESS) return rc; - if (opt.size > sizeof(buffer)) return TWCC_BADVALUE; - rc = sane_option_get_value( opt.optno, buffer ); + if (opt.size > buf_len) return TWCC_BADVALUE; if (rc != TWCC_SUCCESS) return rc; There hasn't been an assignment to `rc` since the previous check.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/5904#note_74148