Module: kamailio Branch: master Commit: 498e225bb52323f92040b8f11223059c06d0dacd URL: https://github.com/kamailio/kamailio/commit/498e225bb52323f92040b8f11223059c...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2015-06-03T11:48:28+02:00
Merge pull request #186 from norox/master
enum: fix buffer overflow and increase maximum number length
---
Modified: modules/enum/enum.c Modified: modules/enum/enum.h
---
Diff: https://github.com/kamailio/kamailio/commit/498e225bb52323f92040b8f11223059c... Patch: https://github.com/kamailio/kamailio/commit/498e225bb52323f92040b8f11223059c...
---
diff --git a/modules/enum/enum.c b/modules/enum/enum.c index 3c21c2f..6439f54 100644 --- a/modules/enum/enum.c +++ b/modules/enum/enum.c @@ -34,7 +34,7 @@ * based on the user part of the current Request-URI. These functions * assume that the Request URI user part consists of an international * phone number of the form +decimal-digits, where the number of digits is - * at least 2 and at most 15. Out of this number enum_query forms a domain + * at least 2 and at most 32. Out of this number enum_query forms a domain * name, where the digits are in reverse order and separated by dots * followed by domain suffix that by default is "e164.arpa.". For example, * if the user part is +35831234567, the domain name will be @@ -1005,7 +1005,7 @@ int enum_pv_query_3(struct sip_msg* _msg, char* _sp, char* _suffix, struct naptr_rdata* naptr; str pattern, replacement, result, new_result; str *suffix, *service; - char string[17]; + char string[MAX_NUM_LEN]; pv_spec_t *sp; pv_value_t pv_val;
diff --git a/modules/enum/enum.h b/modules/enum/enum.h index 838caf6..1f1a509 100644 --- a/modules/enum/enum.h +++ b/modules/enum/enum.h @@ -35,7 +35,7 @@
#define MAX_DOMAIN_SIZE 256 -#define MAX_NUM_LEN 22 +#define MAX_NUM_LEN 33 #define MAX_COMPONENT_SIZE (MAX_NUM_LEN * 2) /* separator, apex, ... This simplifies checks */