Module: kamailio
Branch: master
Commit: b1356efd61e56eaa3426d8e2e813ea6730b4f2c9
URL:
https://github.com/kamailio/kamailio/commit/b1356efd61e56eaa3426d8e2e813ea6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-07-10T09:41:15+02:00
registrar: increase max size for user and domain building aor
- renamed max aor lenght define to match the user and domain style
---
Modified: src/modules/registrar/common.c
Modified: src/modules/registrar/registrar.h
---
Diff:
https://github.com/kamailio/kamailio/commit/b1356efd61e56eaa3426d8e2e813ea6…
Patch:
https://github.com/kamailio/kamailio/commit/b1356efd61e56eaa3426d8e2e813ea6…
---
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