Browse Source

uac: safety checks for empty values in uacreg

- the values in uacreg table must not be empty
- reported by Bernhard Suttner
Daniel-Constantin Mierla 14 years ago
parent
commit
dd663a7338
1 changed files with 5 additions and 0 deletions
  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);