From e77555d30cf3a628b140f9c0c61032a9862fe085 Mon Sep 17 00:00:00 2001 From: Aron Podrigal Date: Wed, 25 Sep 2024 15:45:29 -0500 Subject: [PATCH] [maxfwd]: Fix `is_maxfwd_lt` function limit value Was using the address pointer as value. --- modules/maxfwd/maxfwd.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/maxfwd/maxfwd.c b/modules/maxfwd/maxfwd.c index 434460642b9..76daa174aa7 100644 --- a/modules/maxfwd/maxfwd.c +++ b/modules/maxfwd/maxfwd.c @@ -52,7 +52,7 @@ static int max_limit = MAXFWD_UPPER_LIMIT; static int fixup_maxfwd_header(void** param); static int w_process_maxfwd_header(struct sip_msg* msg, int* mval); -static int is_maxfwd_lt(struct sip_msg *msg, char *slimit, char *foo); +static int is_maxfwd_lt(struct sip_msg *msg, int *limit); static int mod_init(void); @@ -169,20 +169,18 @@ static int w_process_maxfwd_header(struct sip_msg* msg, int* mval) -static int is_maxfwd_lt(struct sip_msg *msg, char *slimit, char *foo) +static int is_maxfwd_lt(struct sip_msg *msg, int *limit) { str mf_value; - int limit; int val; - limit = (int)(long)slimit; val = is_maxfwd_present( msg, &mf_value); - LM_DBG("value = %d \n",val); + LM_DBG("value = %d, limit = %d\n", val, *limit); if ( val<0 ) { /* error or not found */ return val-1; - } else if ( val>=limit ) { + } else if ( val >= *limit ) { /* greater or equal than/to limit */ return -1; }