[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sr-dev
Subject:    [sr-dev] git:master: sercmd: memset with proper size
From:       Daniel-Constantin Mierla <miconda () gmail ! com>
Date:       2014-01-29 21:11:22
Message-ID: 20140129211122.B473FEF8074 () rimmer ! ryngle ! com
[Download RAW message or body]

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


Author: Daniel-Constantin Mierla <miconda@gmail.com>
Committer: Daniel-Constantin Mierla <miconda@gmail.com>
Date:   Wed Jan 29 22:10:09 2014 +0100

sercmd: memset with proper size

---

 utils/sercmd/sercmd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/utils/sercmd/sercmd.c b/utils/sercmd/sercmd.c
index 90dfcb7..7bb435a 100644
--- a/utils/sercmd/sercmd.c
+++ b/utils/sercmd/sercmd.c
@@ -1649,7 +1649,7 @@ static int get_counters_list(int s)
 		grp->var_no = 0;
 		grp->var_names=malloc(sizeof(str)*grp->cnt_vars_no);
 		if (grp->var_names==0) goto error_mem;
-		memset(grp->var_names, 0, sizeof(str)*grp->var_no);
+		memset(grp->var_names, 0, sizeof(str)*grp->cnt_vars_no);
 		for (r=0; r<grp->cnt_vars_no; r++) {
 			if (grp->cnt_vars_array[r].type!=BINRPC_T_STR)
 				continue;


_______________________________________________
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic