winecfg: prevent crash when clearing volume serial number input

Joerg-Cyril.Hoehle at t-systems.com Joerg-Cyril.Hoehle at t-systems.com
Thu Dec 18 07:47:37 CST 2008


Hi,

[resend #1, apparently needs subscription to list or mail is silently dropped?!]

Attached is minor fix to A.Julliard's post 1.1.6 commit
6483f2f201c15b650c5e0e1996cf40d2bb6e057f
winecfg: Store the drive serial number as a number instead of a string

strtoul(NULL) crashes. The former code was careful to special-case the NULL result from get_text(dialog) when the input field is emptied.

In addition, that commit leaks memory from get_text().

While I was at it, I changed logs to be consistent with the upper case serial number output written to .windows-serial.
Winecmd's DIR prints lower case, while ms-w2k DOS window's DIR prints upper case.

Additional thoughts:
- Maybe the serial input field should be initialized with %08X instead of %X to hint at the format? E.g. input of serial numbers like "1122-dacf" as printed by DIR produce 00001122 in winecfg.
- Possibly the input size should be restricted to 8 characters in the GUI?
- Maybe winecfg should echo the number it read into the input field, no later than apply time. Currently one needs to select another driver, then come back to see what it got.

BTW, winecfg does not seem to be able to set .windows-label anymore:
trace:winecfg:apply_drive_changes 
warn:winecfg:set_drive_label unable to set volume label for devicename of L"E:\\", label of L"xyz"
trace:winecfg:PRINTERROR error: 'Access denied'
Looks like http://bugs.winehq.org/show_bug.cgi?id=13273

Regards,
	Jörg Höhle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winecfg-serial-number.patch
Type: application/octet-stream
Size: 2421 bytes
Desc: winecfg-serial-number.patch
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20081218/ba4e1f1b/attachment.obj 


More information about the wine-patches mailing list