瀏覽代碼

uac: safety checks for empty values in uacreg

- the values in uacreg table must not be empty
- reported by Bernhard Suttner
Daniel-Constantin Mierla 15 年之前
父節點
當前提交
dd663a7338
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      modules_k/uac/uac_reg.c

+ 5 - 0
modules_k/uac/uac_reg.c

@@ -663,6 +663,11 @@ void uac_reg_timer(unsigned int ticks)
 			reg.attr.s = \
 				(char*)(RES_ROWS(db_res)[i].values[pos].val.string_val); \
 			reg.attr.len = strlen(reg.attr.s); \
+			if(reg.attr.len == 0) { \
+				LM_ERR("empty value not allowed for column[%d]=%.*s\n", \
+						pos, db_cols[pos]->len, db_cols[pos]->s); \
+				goto error; \
+			} \
 		} \
 	} while(0);