Module: wine Branch: master Commit: 3c5ef7c4ad138ee675520f5a8c325a00a737a352 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3c5ef7c4ad138ee675520f5a8c...
Author: Hans Leidekker hans@codeweavers.com Date: Thu Apr 2 16:16:04 2015 +0200
wbemprox: Make sure to allocate sufficient memory in resize_table.
---
dlls/wbemprox/builtin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 3548c61..f7a9fc7 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -1018,10 +1018,10 @@ static BOOL resize_table( struct table *table, UINT row_count, UINT row_size ) table->num_rows_allocated = row_count; return TRUE; } - if (row_count >= table->num_rows_allocated) + if (row_count > table->num_rows_allocated) { BYTE *data; - UINT count = table->num_rows_allocated * 2; + UINT count = max( row_count, table->num_rows_allocated * 2 ); if (!(data = heap_realloc( table->data, count * row_size ))) return FALSE; table->data = data; table->num_rows_allocated = count;