projects
/
crypto.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fixed reallocation when reducing size.
[crypto.git]
/
lib
/
silcutil
/
silcmemory.c
diff --git
a/lib/silcutil/silcmemory.c
b/lib/silcutil/silcmemory.c
index b1a657b2f335593c91bba82875d9e2ea1d8fb8f6..b7f69df850e64e33bca5d273d9a85f69f055ecf5 100644
(file)
--- a/
lib/silcutil/silcmemory.c
+++ b/
lib/silcutil/silcmemory.c
@@
-155,7
+155,7
@@
void *silc_srealloc(SilcStack stack, SilcUInt32 old_size,
new_ptr = silc_smalloc(stack, size);
if (!new_ptr)
return NULL;
- memcpy(new_ptr, ptr, old_size);
+ memcpy(new_ptr, ptr, old_size
> size ? size : old_size
);
}
return new_ptr;