Hi,

   cbString = SendMessage(handle, CB_GETLBTEXTLEN, index, 0);
   if(cbString != LB_ERR) {
       szString = (char *) safemalloc(cbString);


I've just committed a fix for Combobox.xs (GetString) and Listbox.xs (GetString) - both weren't allocating enough space for the string (I added one to the length of the string). This bug would have been causing 'random' like problems as the buffer was overrun. From the look of things, Perl 5.8.7 would have been more susceptible than Perl 5.6.1 as memory is handled differently in that version of Perl.

I checked all other safemalloc usage within Win32::GUI and everything else looks ok. However, there doesn't seem to be any consistency of how strings are allocated. Sometimes +1 is added sometimes +2 or even +16. All solutions aren't Unicode aware, and going forward it's probably a good idea to create a function/macro to handle the allocation of strings.

Cheers,

jez.



Reply via email to