Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
3163a376
Commit
3163a376
authored
Oct 20, 2011
by
Tristan Matthews
Browse files
* #7245: don't use string indices if they're out of bounds
parent
b8795c9a
Changes
1
Hide whitespace changes
Inline
Side-by-side
daemon/src/sip/sipvoiplink.cpp
View file @
3163a376
...
@@ -383,8 +383,8 @@ Call *SIPVoIPLink::newOutgoingCall(const std::string& id, const std::string& toU
...
@@ -383,8 +383,8 @@ Call *SIPVoIPLink::newOutgoingCall(const std::string& id, const std::string& toU
// If toUri is not a well formated sip URI, use account information to process it
// If toUri is not a well formated sip URI, use account information to process it
std
::
string
toUri
;
std
::
string
toUri
;
if
(
(
toUrl
.
find
(
"sip:"
)
!=
std
::
string
::
npos
)
or
if
(
toUrl
.
find
(
"sip:"
)
!=
std
::
string
::
npos
or
toUrl
.
find
(
"sips:"
)
!=
std
::
string
::
npos
)
toUrl
.
find
(
"sips:"
)
!=
std
::
string
::
npos
)
toUri
=
toUrl
;
toUri
=
toUrl
;
else
else
toUri
=
account
->
getToUri
(
toUrl
);
toUri
=
account
->
getToUri
(
toUrl
);
...
@@ -903,9 +903,15 @@ bool SIPVoIPLink::SIPNewIpToIpCall(const std::string& id, const std::string& to)
...
@@ -903,9 +903,15 @@ bool SIPVoIPLink::SIPNewIpToIpCall(const std::string& id, const std::string& to)
// Init TLS transport if enabled
// Init TLS transport if enabled
if
(
account
->
isTlsEnabled
())
{
if
(
account
->
isTlsEnabled
())
{
int
at
=
toUri
.
find
(
"@"
);
size_t
at
=
toUri
.
find
(
"@"
);
int
trns
=
toUri
.
find
(
";transport"
);
size_t
trns
=
toUri
.
find
(
";transport"
);
std
::
string
remoteAddr
=
toUri
.
substr
(
at
+
1
,
trns
-
at
-
1
);
if
(
at
==
std
::
string
::
npos
or
trns
==
std
::
string
::
npos
)
{
ERROR
(
"UserAgent: Error
\"
@
\"
or
\"
;transport
\"
not in URI %s"
,
toUri
.
c_str
());
delete
call
;
return
false
;
}
std
::
string
remoteAddr
(
toUri
.
substr
(
at
+
1
,
trns
-
at
-
1
));
if
(
toUri
.
find
(
"sips:"
)
!=
1
)
{
if
(
toUri
.
find
(
"sips:"
)
!=
1
)
{
DEBUG
(
"UserAgent: Error
\"
sips
\"
scheme required for TLS call"
);
DEBUG
(
"UserAgent: Error
\"
sips
\"
scheme required for TLS call"
);
...
...
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