Hi all,
Having lately some strange crashes when I start Wine with any --debugmsg command, I started to look at where the problem occured.
From my investigations, it came in the file misc/registry.c while loading
'system.1st' (yeah, I know, I should run in a no-Windows install, but well, my Wine installation is 6 years old and still working, so I won't change now :-) ).
Anyway, the faulty function is '_strdupnA'.
I added some traces and I have this :
0009:trace:reg:_strdupnA System\CurrentControlSet\Control\MediaProperties\PrivateProperties\Joystick (0x3c003f40) 79 0009:trace:reg:_strdupnA 0x3c003f90
This means that the string given as a parameter has the pointer '0x3c003f40', the length parameter is '79' and it returns '0x3c003f90'.
It crashes later on at :
0009:trace:reg:_strdupnA System\CurrentControlSet\Control\MediaProperties\PrivateProperties\Joystick\OEM (0x3c003f90) 114 0009:trace:reg:_strdupnA 0x3c003418
So we give the '0x3c003f90' pointer (which is of length 79 as seen in the previous debug output) but (if you look at the code), will read 114 bytes from it (as the function uses 'memcpy' and not 'strncpy').
The attached patch fixes all crashes on my box, but well, as I am not very familiar with this code, sent it to wine-devel and not wine-patches for review by Registry gurus :-)
Lionel