Explorar o código

Modules:carrierroute: Fixed a bug in carrirroute module that might cause a crash if the routing prob was larger than the number of available routes.

The problem was caused by a missing else
Marius Zbihlei %!s(int64=15) %!d(string=hai) anos
pai
achega
16bdf9ea21
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      modules/carrierroute/cr_func.c

+ 1 - 1
modules/carrierroute/cr_func.c

@@ -257,7 +257,7 @@ static struct route_rule * get_rule_by_hash(const struct route_flags * rf,
 		LM_WARN("too large desired hash, taking highest\n");
 		act_hash = rf->rules[rf->rule_num - 1];
 	}
-	act_hash = rf->rules[prob - 1];
+	else act_hash = rf->rules[prob - 1];
 
 	if (!act_hash->status) {
 		if (act_hash->backup && act_hash->backup->rr) {