Module: kamailio
Branch: master
Commit: e9c2022b57be87403bb2aa703f74b5d218456aeb
URL:
https://github.com/kamailio/kamailio/commit/e9c2022b57be87403bb2aa703f74b5d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-09-23T14:41:56+02:00
Merge pull request #338 from doublec/htable_overrun
htable: Fix buffer overrun in htable_rpc_list
---
Modified: modules/htable/htable.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e9c2022b57be87403bb2aa703f74b5d…
Patch:
https://github.com/kamailio/kamailio/commit/e9c2022b57be87403bb2aa703f74b5d…
---
diff --git a/modules/htable/htable.c b/modules/htable/htable.c
index c6e2250..8339e41 100644
--- a/modules/htable/htable.c
+++ b/modules/htable/htable.c
@@ -1044,7 +1044,7 @@ static void htable_rpc_list(rpc_t* rpc, void* c)
if (ht->dbtable.len > 0) {
len = ht->dbtable.len > 127 ? 127 : ht->dbtable.len;
memcpy(dbname, ht->dbtable.s, len);
- dbname[ht->dbtable.len] = '\0';
+ dbname[len] = '\0';
} else {
dbname[0] = '\0';
}