Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
a647036c
Commit
a647036c
authored
May 15, 2009
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a possible crash if the address is invalid
parent
2dc51dd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
18 deletions
+21
-18
agent/agent.c
agent/agent.c
+21
-18
No files found.
agent/agent.c
View file @
a647036c
...
@@ -1174,9 +1174,11 @@ static void _upnp_mapped_external_port (GUPnPSimpleIgd *self, gchar *proto,
...
@@ -1174,9 +1174,11 @@ static void _upnp_mapped_external_port (GUPnPSimpleIgd *self, gchar *proto,
nice_debug
(
"Agent %p : Sucessfully mapped %s:%d to %s:%d"
,
agent
,
local_ip
,
nice_debug
(
"Agent %p : Sucessfully mapped %s:%d to %s:%d"
,
agent
,
local_ip
,
local_port
,
external_ip
,
external_port
);
local_port
,
external_ip
,
external_port
);
nice_address_set_from_string
(
&
localaddr
,
local_ip
);
if
(
!
nice_address_set_from_string
(
&
localaddr
,
local_ip
))
goto
end
;
nice_address_set_port
(
&
localaddr
,
local_port
);
nice_address_set_port
(
&
localaddr
,
local_port
);
nice_address_set_from_string
(
&
externaddr
,
external_ip
);
if
(
!
nice_address_set_from_string
(
&
externaddr
,
external_ip
))
goto
end
;
nice_address_set_port
(
&
externaddr
,
external_port
);
nice_address_set_port
(
&
externaddr
,
external_port
);
for
(
i
=
agent
->
upnp_mapping
;
i
;
i
=
i
->
next
)
{
for
(
i
=
agent
->
upnp_mapping
;
i
;
i
=
i
->
next
)
{
...
@@ -1234,25 +1236,26 @@ static void _upnp_error_mapping_port (GUPnPSimpleIgd *self, GError *error,
...
@@ -1234,25 +1236,26 @@ static void _upnp_error_mapping_port (GUPnPSimpleIgd *self, GError *error,
nice_debug
(
"Agent %p : Error mapping %s:%d to %d (%d) : %s"
,
agent
,
local_ip
,
nice_debug
(
"Agent %p : Error mapping %s:%d to %d (%d) : %s"
,
agent
,
local_ip
,
local_port
,
external_port
,
error
->
domain
,
error
->
message
);
local_port
,
external_port
,
error
->
domain
,
error
->
message
);
nice_address_set_from_string
(
&
localaddr
,
local_ip
);
if
(
nice_address_set_from_string
(
&
localaddr
,
local_ip
))
{
nice_address_set_port
(
&
localaddr
,
local_port
);
nice_address_set_port
(
&
localaddr
,
local_port
);
for
(
i
=
agent
->
upnp_mapping
;
i
;
i
=
i
->
next
)
{
for
(
i
=
agent
->
upnp_mapping
;
i
;
i
=
i
->
next
)
{
NiceAddress
*
addr
=
i
->
data
;
NiceAddress
*
addr
=
i
->
data
;
if
(
nice_address_equal
(
&
localaddr
,
addr
))
{
if
(
nice_address_equal
(
&
localaddr
,
addr
))
{
agent
->
upnp_mapping
=
g_slist_remove
(
agent
->
upnp_mapping
,
addr
);
agent
->
upnp_mapping
=
g_slist_remove
(
agent
->
upnp_mapping
,
addr
);
nice_address_free
(
addr
);
nice_address_free
(
addr
);
break
;
break
;
}
}
}
}
if
(
g_slist_length
(
agent
->
upnp_mapping
))
{
if
(
g_slist_length
(
agent
->
upnp_mapping
))
{
if
(
agent
->
upnp_timer_source
!=
NULL
)
{
if
(
agent
->
upnp_timer_source
!=
NULL
)
{
g_source_destroy
(
agent
->
upnp_timer_source
);
g_source_destroy
(
agent
->
upnp_timer_source
);
g_source_unref
(
agent
->
upnp_timer_source
);
g_source_unref
(
agent
->
upnp_timer_source
);
agent
->
upnp_timer_source
=
NULL
;
agent
->
upnp_timer_source
=
NULL
;
}
agent_gathering_done
(
agent
);
}
}
agent_gathering_done
(
agent
);
}
}
g_static_rec_mutex_unlock
(
&
agent
->
mutex
);
g_static_rec_mutex_unlock
(
&
agent
->
mutex
);
...
...
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