Module: kamailio
Branch: master
Commit: a16c6108e1f6d1a3f6b6c962bbaaedf37e57a8d2
URL:
https://github.com/kamailio/kamailio/commit/a16c6108e1f6d1a3f6b6c962bbaaedf…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-08-22T09:47:43+02:00
db_postgres: memset vars to 0 to avoid using invalid values inside
db_postgres_new_connection()
- reported by mading087, GH#292
---
Modified: modules/db_postgres/km_pg_con.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a16c6108e1f6d1a3f6b6c962bbaaedf…
Patch:
https://github.com/kamailio/kamailio/commit/a16c6108e1f6d1a3f6b6c962bbaaedf…
---
diff --git a/modules/db_postgres/km_pg_con.c b/modules/db_postgres/km_pg_con.c
index d053c55..ec98add 100644
--- a/modules/db_postgres/km_pg_con.c
+++ b/modules/db_postgres/km_pg_con.c
@@ -71,6 +71,10 @@ struct pg_con* db_postgres_new_connection(struct db_id* id)
memset(ptr, 0, sizeof(struct pg_con));
ptr->ref = 1;
+ memset(keywords, 0, (sizeof(char*) * 10));
+ memset(values, 0, (sizeof(char*) * 10));
+ memset(to, 0, (sizeof(char) * 16));
+
if (id->port) {
ports = int2str(id->port, 0);
keywords[i] = "port";