Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[maxfwd]: Fix bug is_maxfwd_lt function limit value #3480

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions modules/maxfwd/maxfwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);


Expand Down Expand Up @@ -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;
}
Expand Down
Loading