Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
videolan
vlc
Commits
c758dd29
Commit
c758dd29
authored
Oct 09, 2007
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bonjour: checks asprintf() return value, checks name before using it
parent
8acbb8ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
modules/services_discovery/bonjour.c
modules/services_discovery/bonjour.c
+15
-7
No files found.
modules/services_discovery/bonjour.c
View file @
c758dd29
...
...
@@ -141,7 +141,8 @@ static void resolve_callback(
avahi_address_snprint
(
a
,
(
sizeof
(
a
)
/
sizeof
(
a
[
0
]))
-
1
,
address
);
if
(
protocol
==
AVAHI_PROTO_INET6
)
asprintf
(
&
psz_addr
,
"[%s]"
,
a
);
if
(
asprintf
(
&
psz_addr
,
"[%s]"
,
a
)
==
-
1
)
return
;
if
(
txt
!=
NULL
)
asl
=
avahi_string_list_find
(
txt
,
"path"
);
...
...
@@ -153,8 +154,12 @@ static void resolve_callback(
if
(
avahi_string_list_get_pair
(
asl
,
&
key
,
&
value
,
&
size
)
==
0
&&
value
!=
NULL
)
{
asprintf
(
&
psz_uri
,
"http://%s:%d%s"
,
psz_addr
!=
NULL
?
psz_addr
:
a
,
port
,
value
);
if
(
asprintf
(
&
psz_uri
,
"http://%s:%d%s"
,
psz_addr
!=
NULL
?
psz_addr
:
a
,
port
,
value
)
==
-
1
)
{
free
(
psz_addr
);
return
;
}
}
if
(
key
!=
NULL
)
avahi_free
(
(
void
*
)
key
);
...
...
@@ -163,8 +168,12 @@ static void resolve_callback(
}
else
{
asprintf
(
&
psz_uri
,
"http://%s:%d"
,
psz_addr
!=
NULL
?
psz_addr
:
a
,
port
);
if
(
asprintf
(
&
psz_uri
,
"http://%s:%d"
,
psz_addr
!=
NULL
?
psz_addr
:
a
,
port
)
==
-
1
)
{
free
(
psz_addr
);
return
;
}
}
if
(
psz_addr
!=
NULL
)
...
...
@@ -204,7 +213,6 @@ static void browse_callback(
{
services_discovery_t
*
p_sd
=
(
services_discovery_t
*
)
userdata
;
services_discovery_sys_t
*
p_sys
=
p_sd
->
p_sys
;
if
(
event
==
AVAHI_BROWSER_NEW
)
{
if
(
avahi_service_resolver_new
(
p_sys
->
client
,
interface
,
protocol
,
...
...
@@ -218,7 +226,7 @@ static void browse_callback(
avahi_strerror
(
avahi_client_errno
(
p_sys
->
client
)
)
);
}
}
else
else
if
(
name
)
{
/** \todo Store the input id and search it, rather than searching the items */
input_item_t
*
p_item
;
...
...
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