msvcrt: Fix error handling in _aligned_offset_realloc().

This commit is contained in:
Gerald Pfeifer 2007-12-03 22:56:37 +01:00 committed by Alexandre Julliard
parent 00a961c5d4
commit a030777f74
1 changed files with 3 additions and 2 deletions

View File

@ -443,13 +443,14 @@ void * CDECL _aligned_offset_realloc(void *memblock, MSVCRT_size_t size,
/* It seems this function was called with an invalid pointer. Bail out. */
return NULL;
}
/* Adjust old_size to get amount of actual data in old block. */
old_size -= old_padding;
if (old_size < 0)
if (old_size < old_padding)
{
/* Shouldn't happen. Something's weird, so bail out. */
return NULL;
}
old_size -= old_padding;
temp = MSVCRT_realloc(*saved, size + alignment + sizeof(void *));