[sr-dev] git:master: nat_traversal: proper size for realloc

Daniel-Constantin Mierla miconda at gmail.com
Mon Feb 24 21:34:02 CET 2014


Module: sip-router
Branch: master
Commit: d9c34bec5ea0570f66df23e7e7d6f79f4721f04e
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d9c34bec5ea0570f66df23e7e7d6f79f4721f04e

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Mon Feb 24 21:32:45 2014 +0100

nat_traversal: proper size for realloc

- reported by Venky

---

 modules/nat_traversal/nat_traversal.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/nat_traversal/nat_traversal.c b/modules/nat_traversal/nat_traversal.c
index 3368689..92ddd4c 100644
--- a/modules/nat_traversal/nat_traversal.c
+++ b/modules/nat_traversal/nat_traversal.c
@@ -685,7 +685,7 @@ Dialog_Param_add_candidate(Dialog_Param *param, char *candidate)
     if (param->callee_candidates.count == param->callee_candidates.size) {
         new_size = param->callee_candidates.size + URI_LIST_RESIZE_INCREMENT;
         LM_DBG("growing callee_candidates list size from %d to %d entries\n", param->callee_candidates.size, new_size);
-        new_uri = shm_realloc(param->callee_candidates.uri, new_size);
+        new_uri = shm_realloc(param->callee_candidates.uri, new_size * sizeof(char*));
         if (!new_uri) {
             LM_ERR("failed to grow callee_candidates uri list\n");
             return False;




More information about the sr-dev mailing list