Browse code

- 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 <pintea@iptego.de>. Closes SER-338.

Andrei Pelinescu-Onciul authored on 23/02/2008 13:10:19
Showing 1 changed files
... ...
@@ -630,7 +630,8 @@ inline static int comp_str(int op, str* left, int rtype, union exp_op* r, struct
630 630
 			 * $test > 10
631 631
 			 * the right operator MUST be number to do the conversion
632 632
 			 */
633
-		str2int(left,&l);
633
+		if (str2int(left,&l) < 0)
634
+			goto error;
634 635
 		return comp_num(op, l, rtype, r);
635 636
 	} else {
636 637
 		LOG(L_CRIT, "BUG: comp_str: Bad type %d, "