From b1356efd61e56eaa3426d8e2e813ea6730b4f2c9 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Fri, 7 Jul 2023 17:41:15 +0200 Subject: [PATCH] registrar: increase max size for user and domain building aor - renamed max aor lenght define to match the user and domain style --- src/modules/registrar/common.c | 8 ++++---- src/modules/registrar/registrar.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modules/registrar/common.c b/src/modules/registrar/common.c index 9e619190644..6142d277d36 100644 --- a/src/modules/registrar/common.c +++ b/src/modules/registrar/common.c @@ -34,14 +34,14 @@ #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; @@ -49,7 +49,7 @@ int extract_aor(str *_uri, str *_a, sip_uri_t *_pu) 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) @@ -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; diff --git a/src/modules/registrar/registrar.h b/src/modules/registrar/registrar.h index 68b00671f0e..bd28b5bd8fd 100644 --- a/src/modules/registrar/registrar.h +++ b/src/modules/registrar/registrar.h @@ -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