Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
130
Issues
130
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
c0213533
Commit
c0213533
authored
May 16, 2012
by
Tristan Matthews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* #10732: sipvoiplink: fix code that validates IP address
parent
b2e4ab4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
daemon/src/sip/sipvoiplink.cpp
daemon/src/sip/sipvoiplink.cpp
+10
-2
No files found.
daemon/src/sip/sipvoiplink.cpp
View file @
c0213533
...
...
@@ -667,8 +667,14 @@ void SIPVoIPLink::cancelKeepAliveTimer(pj_timer_entry& timer)
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
;
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
;
}
...
...
@@ -1629,8 +1635,10 @@ void update_contact_header(pjsip_regc_cbparam *param, SIPAccount *account)
// TODO: make this based on transport 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
;
}
std
::
string
recvContactHost
(
uri
->
host
.
ptr
,
uri
->
host
.
slen
);
std
::
stringstream
ss
;
...
...
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