mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-30 16:17:02 +01:00
Fix computation of NEWSIZE in es_func_mem_write.
The function used to fail and return EINVAL when enlarging the buffer.
This commit is contained in:
parent
52b9761c88
commit
dcd20e18a5
@ -1,3 +1,7 @@
|
||||
2011-01-18 Werner Koch <wk@g10code.com>
|
||||
|
||||
* estream.c (es_func_mem_write): FIX computation of NEWSIZE.
|
||||
|
||||
2011-01-10 Werner Koch <wk@g10code.com>
|
||||
|
||||
* session-env.c (update_var): Fix same value detection. Fixes
|
||||
|
@ -641,7 +641,7 @@ es_func_mem_write (void *cookie, const void *buffer, size_t size)
|
||||
if (!mem_cookie->memory_size)
|
||||
newsize = size; /* Not yet allocated. */
|
||||
else
|
||||
newsize = mem_cookie->memory_size + (nleft - size);
|
||||
newsize = mem_cookie->memory_size + (size - nleft);
|
||||
if (newsize < mem_cookie->offset)
|
||||
{
|
||||
_set_errno (EINVAL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user