Fabian Cenedese Cenedese@indel.ch writes:
The found value (info->Data) should only be copied to (buffer) if its length (len) is big enough. len is given in bytes (8 for the above call with a buffer of 4 WCHARs). But the length of the data (ret) is in WCHAR units. So the comparison here is completely wrong. Ok, I could change this to len/sizeof(WCHAR). But that's still not enough because of the comparison before about info->Data[ret-1].
len is supposed to be in WCHARs too, most likely the caller is not passing the correct size.