Ver Fonte

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 há 15 anos atrás
pai
commit
2095981e8b
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      modules/carrierroute/cr_func.c

+ 1 - 1
modules/carrierroute/cr_func.c

@@ -249,7 +249,7 @@ static struct route_rule * get_rule_by_hash(const struct route_flags * rf,
 		LM_WARN("too large desired hash, taking highest\n");
 		LM_WARN("too large desired hash, taking highest\n");
 		act_hash = rf->rules[rf->rule_num - 1];
 		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->status) {
 		if (act_hash->backup && act_hash->backup->rr) {
 		if (act_hash->backup && act_hash->backup->rr) {