[sr-dev] git:4.0: modules/pipelimit: check correctly for all arguments in mi_set_pipe

Vicente Hernando vhernando at systemonenoc.com
Wed Apr 10 13:57:55 CEST 2013


Module: sip-router
Branch: 4.0
Commit: 3b9347e41195587c323f5d6d643c1807a9905941
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3b9347e41195587c323f5d6d643c1807a9905941

Author: Vicente Hernando <vhernando at systemonenoc.com>
Committer: Vicente Hernando <vhernando at systemonenoc.com>
Date:   Wed Apr 10 13:55:57 2013 +0200

modules/pipelimit: check correctly for all arguments in mi_set_pipe
(cherry picked from commit d17b02ed5014b4e32bd0060f32cabd750956779c)

---

 modules/pipelimit/pl_ht.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/pipelimit/pl_ht.c b/modules/pipelimit/pl_ht.c
index c144e7e..1146468 100644
--- a/modules/pipelimit/pl_ht.c
+++ b/modules/pipelimit/pl_ht.c
@@ -544,7 +544,7 @@ struct mi_root* mi_set_pipe(struct mi_root* cmd_tree, void* param)
 	pipeid = node->value;
 	
 	node = node->next;
-	if ( !node->value.s || !node->value.len)
+	if ( !node || !node->value.s || !node->value.len)
 		goto error;
 	if (str_map_str(algo_names, &(node->value), (int*)&algo_id)) {
 		LM_ERR("unknown algorithm: '%.*s'\n", node->value.len, node->value.s);
@@ -552,7 +552,7 @@ struct mi_root* mi_set_pipe(struct mi_root* cmd_tree, void* param)
 	}
 	
 	node = node->next;
-	if ( !node->value.s || !node->value.len || strno2int(&node->value,&limit)<0)
+	if ( !node || !node->value.s || !node->value.len || strno2int(&node->value,&limit)<0)
 		goto error;
 
 	LM_DBG("set_pipe: %.*s:%d:%d\n", pipeid.len, pipeid.s, algo_id, limit);




More information about the sr-dev mailing list