Переглянути джерело

- fix: return status not checked when converting a string into a number in
comp_str(...) (used when comparing string to numbers in ser.cfg). Patch from
Bogdan Pintea <[email protected]>.
Closes SER-338.

Andrei Pelinescu-Onciul 17 роки тому
батько
коміт
fddc0b6631
1 змінених файлів з 2 додано та 1 видалено
  1. 2 1
      route.c

+ 2 - 1
route.c

@@ -630,7 +630,8 @@ inline static int comp_str(int op, str* left, int rtype, union exp_op* r, struct
 			 * $test > 10
 			 * $test > 10
 			 * the right operator MUST be number to do the conversion
 			 * the right operator MUST be number to do the conversion
 			 */
 			 */
-		str2int(left,&l);
+		if (str2int(left,&l) < 0)
+			goto error;
 		return comp_num(op, l, rtype, r);
 		return comp_num(op, l, rtype, r);
 	} else {
 	} else {
 		LOG(L_CRIT, "BUG: comp_str: Bad type %d, "
 		LOG(L_CRIT, "BUG: comp_str: Bad type %d, "