Module: kamailio
Branch: master
Commit: f3f14c6d85a7055c3a729ec46b83ff2a179ac397
URL:
https://github.com/kamailio/kamailio/commit/f3f14c6d85a7055c3a729ec46b83ff2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-06-06T14:34:56+02:00
dispatcher: safety check for null value of attrs field in database
---
Modified: src/modules/dispatcher/dispatch.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f3f14c6d85a7055c3a729ec46b83ff2…
Patch:
https://github.com/kamailio/kamailio/commit/f3f14c6d85a7055c3a729ec46b83ff2…
---
diff --git a/src/modules/dispatcher/dispatch.c b/src/modules/dispatcher/dispatch.c
index cbda9731e6..740b678e51 100644
--- a/src/modules/dispatcher/dispatch.c
+++ b/src/modules/dispatcher/dispatch.c
@@ -962,9 +962,9 @@ int ds_load_db(void)
attrs.s = 0;
attrs.len = 0;
- if(nrcols >= 5) {
+ if(nrcols >= 5 && !VAL_NULL(values + 4)) {
attrs.s = VAL_STR(values + 4).s;
- attrs.len = strlen(attrs.s);
+ if(attrs.s) attrs.len = strlen(attrs.s);
}
if(add_dest2list(id, uri, flags, priority, &attrs, *next_idx, &setn)
!= 0) {