28 Jul
2022
28 Jul
'22
10:31 a.m.
Zhiyi Zhang (@zhiyi) commented about dlls/win32u/sysparams.c:
{ lstrcpyW( device_name, adapter->dev.device_name ); lstrcpyW( adapter_path, adapter->config_key ); + size = sizeof(DEVMODEW) + adapter->modes[0].dmDriverExtra; + /* allocate an extra mode for easier iteration */ + modes = calloc( adapter->mode_count + 1, size ); + if (modes) memcpy( modes, adapter->modes, adapter->mode_count * size );
I think you can avoid the memory copying here as well. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/551#note_5239