Module: kamailio
Branch: master
Commit: 4484a5eb9e0dd6e6723390cb96c378f88f1fd074
URL:
https://github.com/kamailio/kamailio/commit/4484a5eb9e0dd6e6723390cb96c378f…
Author: S-P Chan <shihping.chan(a)gmail.com>
Committer: S-P Chan <shihping.chan(a)gmail.com>
Date: 2022-06-23T10:10:11+08:00
tls_wolfssl: ser_realloc realign memory correctly to 16-bytes
If shm_realloc returns a different 8/16 byte alignment we
need to memmove the correct amount.
---
Modified: src/modules/tls_wolfssl/tls_init.c
---
Diff:
https://github.com/kamailio/kamailio/commit/4484a5eb9e0dd6e6723390cb96c378f…
Patch:
https://github.com/kamailio/kamailio/commit/4484a5eb9e0dd6e6723390cb96c378f…
---
diff --git a/src/modules/tls_wolfssl/tls_init.c b/src/modules/tls_wolfssl/tls_init.c
index 1fcac5549d..9993c4a3d5 100644
--- a/src/modules/tls_wolfssl/tls_init.c
+++ b/src/modules/tls_wolfssl/tls_init.c
@@ -243,7 +243,7 @@ static void* ser_realloc(void *ptr, size_t new_size)
*(size_t*)new_ptr = new_size;
int new_pad = MAX_ALIGN - ((long) new_ptr % MAX_ALIGN);
if (new_pad != pad) {
- memmove(new_ptr + MAX_ALIGN + new_pad, new_ptr + MAX_ALIGN + pad, size);
+ memmove(new_ptr + MAX_ALIGN + new_pad, new_ptr + MAX_ALIGN + pad, new_size);
memset(new_ptr + MAX_ALIGN, new_pad, new_pad);
}