Browse code

msilo: skip invalid stored records

(cherry picked from commit e5efcbdd7be9897cf169b28a7a52c45bff24cac3)

Daniel-Constantin Mierla authored on 03/05/2022 17:19:52
Showing 1 changed files
... ...
@@ -1406,6 +1406,10 @@ void m_send_ontimer(unsigned int ticks, void *param)
1406 1406
 		SET_STR_VAL(str_vals[0], db_res, i, 1); /* user */
1407 1407
 		SET_STR_VAL(str_vals[1], db_res, i, 2); /* host */
1408 1408
 		SET_STR_VAL(str_vals[2], db_res, i, 3); /* body */
1409
+		if(str_vals[0].s==NULL || str_vals[1].s==NULL || str_vals[2].s==NULL) {
1410
+			LM_DBG("message[%d] mid=%d has no user, host or body\n", i, mid);
1411
+			continue;
1412
+		}
1409 1413
 		SET_STR_VAL(str_vals[3], db_res, i, 4); /* ctype */
1410 1414
 
1411 1415
 		extra_hdrs_str.len = 0;