[prev in list] [next in list] [prev in thread] [next in thread]
List: openser-devel
Subject: [sr-dev] git:master:f39736b2: modules/htable: improves error message when loading from database
From: Mikko Lehto <mslehto () iki ! fi>
Date: 2015-06-25 20:20:04
Message-ID: E1Z8Dcy-000854-Te () www ! kamailio ! org
[Download RAW message or body]
Module: kamailio
Branch: master
Commit: f39736b276878f0de1e0471311119f12f1878801
URL: https://github.com/kamailio/kamailio/commit/f39736b276878f0de1e0471311119f12f1878801
Author: Mikko Lehto <mslehto@iki.fi>
Committer: Mikko Lehto <mslehto@iki.fi>
Date: 2015-06-25T20:00:54+03:00
modules/htable: improves error message when loading from database
---
Modified: modules/htable/ht_db.c
---
Diff: https://github.com/kamailio/kamailio/commit/f39736b276878f0de1e0471311119f12f1878801.diff
Patch: https://github.com/kamailio/kamailio/commit/f39736b276878f0de1e0471311119f12f1878801.patch
---
diff --git a/modules/htable/ht_db.c b/modules/htable/ht_db.c
index 06f3057..4288554 100644
--- a/modules/htable/ht_db.c
+++ b/modules/htable/ht_db.c
@@ -197,11 +197,17 @@ int ht_db_load_table(ht_t *ht, str *dbtable, int mode)
do {
for(i=0; i<RES_ROW_N(db_res); i++)
{
- if(RES_ROWS(db_res)[i].values[0].type!=DB1_STRING
- || VAL_NULL(&RES_ROWS(db_res)[i].values[0])) {
- LM_ERR("key type must be string and its value not null\n");
+ if(VAL_NULL(&RES_ROWS(db_res)[i].values[0])) {
+ LM_ERR("key value must not be null\n");
goto error;
}
+
+ if(RES_ROWS(db_res)[i].values[0].type!=DB1_STRING) {
+ LM_ERR("key type must be string (type=%d)\n",
+ RES_ROWS(db_res)[i].values[0].type);
+ goto error;
+ }
+
kname.s = (char*)(RES_ROWS(db_res)[i].values[0].val.string_val);
if(kname.s==NULL) {
LM_ERR("null key in row %d\n", i);
_______________________________________________
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