Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
c0213533
Commit
c0213533
authored
13 years ago
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #10732: sipvoiplink: fix code that validates IP address
parent
b2e4ab4e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
daemon/src/sip/sipvoiplink.cpp
+10
-2
10 additions, 2 deletions
daemon/src/sip/sipvoiplink.cpp
with
10 additions
and
2 deletions
daemon/src/sip/sipvoiplink.cpp
+
10
−
2
View file @
c0213533
...
@@ -667,8 +667,14 @@ void SIPVoIPLink::cancelKeepAliveTimer(pj_timer_entry& timer)
...
@@ -667,8 +667,14 @@ void SIPVoIPLink::cancelKeepAliveTimer(pj_timer_entry& timer)
bool
isValidIpAddress
(
const
std
::
string
&
address
)
bool
isValidIpAddress
(
const
std
::
string
&
address
)
{
{
size_t
pos
=
address
.
find
(
":"
);
std
::
string
address_without_port
(
address
);
if
(
pos
!=
std
::
string
::
npos
)
address_without_port
=
address
.
substr
(
0
,
pos
);
DEBUG
(
"Testing address %s"
,
address_without_port
.
c_str
());
struct
sockaddr_in
sa
;
struct
sockaddr_in
sa
;
int
result
=
inet_pton
(
AF_INET
,
address
.
data
(),
&
(
sa
.
sin_addr
));
int
result
=
inet_pton
(
AF_INET
,
address
_without_port
.
data
(),
&
(
sa
.
sin_addr
));
return
result
!=
0
;
return
result
!=
0
;
}
}
...
@@ -1629,8 +1635,10 @@ void update_contact_header(pjsip_regc_cbparam *param, SIPAccount *account)
...
@@ -1629,8 +1635,10 @@ void update_contact_header(pjsip_regc_cbparam *param, SIPAccount *account)
// TODO: make this based on transport type
// TODO: make this based on transport type
// with pjsip_transport_get_default_port_for_type(tp_type);
// with pjsip_transport_get_default_port_for_type(tp_type);
if
(
uri
->
port
==
0
)
if
(
uri
->
port
==
0
)
{
ERROR
(
"Port is 0 in uri"
);
uri
->
port
=
DEFAULT_SIP_PORT
;
uri
->
port
=
DEFAULT_SIP_PORT
;
}
std
::
string
recvContactHost
(
uri
->
host
.
ptr
,
uri
->
host
.
slen
);
std
::
string
recvContactHost
(
uri
->
host
.
ptr
,
uri
->
host
.
slen
);
std
::
stringstream
ss
;
std
::
stringstream
ss
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment