- deal with the case of argument with 'nonnull' attribute passed null
(cherry picked from commit 69c004eec161c14d957f9e4011aeff4163af858d)
... | ... |
@@ -147,6 +147,12 @@ int set_mod_param_regex(char* regex, char* name, modparam_t type, void* val) |
147 | 147 |
break; |
148 | 148 |
|
149 | 149 |
case PARAM_STR: |
150 |
+ if( ((str*)val2)->s==NULL) { |
|
151 |
+ LM_ERR("null value\n"); |
|
152 |
+ regfree(&preg); |
|
153 |
+ pkg_free(reg); |
|
154 |
+ return -1; |
|
155 |
+ } |
|
150 | 156 |
((str*)ptr)->s = pkg_malloc(((str*)val2)->len+1); |
151 | 157 |
if (!((str*)ptr)->s) { |
152 | 158 |
PKG_MEM_ERROR; |