Browse code

modules/dialplan: added check that database string value is not null - Added NULL check to GET_STR_VALUE macro. - Credits to Bogdan-Andrei Iancu.

Juha Heinanen authored on 09/07/2010 09:54:01
Showing 1 changed files
... ...
@@ -61,6 +61,11 @@ static db_func_t dp_dbf;
61 61
 
62 62
 #define GET_STR_VALUE(_res, _values, _index)\
63 63
 	do{\
64
+		if ( VAL_NULL((_values)+ (_index)) ) { \
65
+			LM_ERR(" values %d is NULL - not allowed\n",_index);\
66
+			(_res).s = 0; (_res).len = 0;\
67
+			goto err;\
68
+		} \
64 69
 		(_res).s = VAL_STR((_values)+ (_index)).s;\
65 70
 		(_res).len = strlen(VAL_STR((_values)+ (_index)).s);\
66 71
 	}while(0);