Skip to content

Commit

Permalink
registrar: increase max size for user and domain building aor
Browse files Browse the repository at this point in the history
- renamed max aor lenght define to match the user and domain style
  • Loading branch information
miconda committed Jul 10, 2023
1 parent 883f6b7 commit b1356ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/modules/registrar/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@
#include "common.h"
#include "config.h"

#define MAX_AOR_LEN 256
#define AOR_MAX_SIZE 512

/*! \brief
* Extract Address of Record
*/
int extract_aor(str *_uri, str *_a, sip_uri_t *_pu)
{
static char aor_buf[MAX_AOR_LEN];
static char aor_buf[AOR_MAX_SIZE];
str tmp;
sip_uri_t turi;
sip_uri_t *puri;
int user_len;
str *uri;
str realm_prefix = {0};

memset(aor_buf, 0, MAX_AOR_LEN);
memset(aor_buf, 0, AOR_MAX_SIZE);
uri = _uri;

if(_pu != NULL)
Expand All @@ -63,7 +63,7 @@ int extract_aor(str *_uri, str *_a, sip_uri_t *_pu)
return -1;
}

if((puri->user.len + puri->host.len + 1) > MAX_AOR_LEN
if((puri->user.len + puri->host.len + 2) > AOR_MAX_SIZE
|| puri->user.len > USERNAME_MAX_SIZE
|| puri->host.len > DOMAIN_MAX_SIZE) {
rerrno = R_AOR_LEN;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/registrar/registrar.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
extern int
contact_max_size; /* configurable using module parameter "contact_max_size" instead of compile time constant */
#define RECEIVED_MAX_SIZE 255
#define USERNAME_MAX_SIZE 64
#define DOMAIN_MAX_SIZE 128
#define USERNAME_MAX_SIZE 248
#define DOMAIN_MAX_SIZE 248
#define CALLID_MAX_SIZE 255

#define PATH_MODE_STRICT 2
Expand Down

0 comments on commit b1356ef

Please sign in to comment.