Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
93972b58
Commit
93972b58
authored
Nov 06, 2015
by
Gautier Pelloux-Prayer
Committed by
Ghislain MARY
Nov 10, 2015
Browse files
enum.c: fix crash in create_enum_domain (use int, not size_t when strlen == 1)
parent
3e633fb4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
coreapi/enum.c
coreapi/enum.c
+7
-7
No files found.
coreapi/enum.c
View file @
93972b58
...
...
@@ -33,8 +33,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static
char
*
create_enum_domain
(
const
char
*
number
){
size_t
len
=
strlen
(
number
);
char
*
domain
=
ms_malloc
((
len
*
2
)
+
10
);
size_t
i
,
j
;
long
i
,
j
;
for
(
i
=
0
,
j
=
len
-
1
;
j
>=
0
;
j
--
){
domain
[
i
]
=
number
[
j
];
i
++
;
...
...
@@ -105,11 +105,11 @@ int enum_lookup(const char *enum_domain, enum_lookup_res_t **res){
/*
ns_msg handle;
int count;
memset(&handle,0,sizeof(handle));
*res=NULL;
ms_message("Resolving %s...",enum_domain);
err=res_search(enum_domain,ns_c_in,ns_t_naptr,dns_answer,DNS_ANSWER_MAX_SIZE);
if (err<0){
ms_warning("Error resolving enum:",herror(h_errno));
...
...
@@ -117,7 +117,7 @@ int enum_lookup(const char *enum_domain, enum_lookup_res_t **res){
}
ns_initparse(dns_answer,DNS_ANSWER_MAX_SIZE,&handle);
count=ns_msg_count(handle,ns_s_an);
for(i=0;i<count;i++){
ns_rr rr;
memset(&rr,0,sizeof(rr));
...
...
@@ -136,9 +136,9 @@ int enum_lookup(const char *enum_domain, enum_lookup_res_t **res){
}
else
{
ms_warning
(
"Could not spawn the
\'
host
\'
command."
);
return
-
1
;
}
}
ms_message
(
"Answer received from dns (err=%i): %s"
,
err
,
host_result
);
begin
=
strstr
(
host_result
,
"sip:"
);
if
(
begin
==
0
)
{
ms_warning
(
"No sip address found in dns naptr answer."
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment