msvcr90: realloc can move memory block.

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


_recalloc contains such code:

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

     if(size>old_size)
         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: <http://www.winehq.org/pipermail/wine-patches/attachments/20120227/9a48e222/attachment.txt>


More information about the wine-patches mailing list