msvcr90: realloc can move memory block.

Alexander Morozov amorozov at
Mon Feb 27 05:56:17 CST 2012

_recalloc contains such code:

     ret = realloc(mem, size);
     if(!ret) {
         *_errno() = ENOMEM;
         return NULL;

         memset((BYTE*)mem+old_size, 0, size-old_size);

Here realloc can return pointer ret which is not equal to mem.
In such case memset corrupts memory.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-msvcr90-realloc-can-move-memory-block.txt
URL: <>

More information about the wine-patches mailing list