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
b12a0599
Commit
b12a0599
authored
Nov 14, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport [17458]: ignore reserved bit, pick result of realloc and boundary check
parent
eb0ae71f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
modules/services_discovery/sap.c
modules/services_discovery/sap.c
+7
-9
No files found.
modules/services_discovery/sap.c
View file @
b12a0599
...
@@ -642,12 +642,6 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
...
@@ -642,12 +642,6 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
i_address_type
=
p_buffer
[
0
]
&
0x10
;
i_address_type
=
p_buffer
[
0
]
&
0x10
;
if
(
(
p_buffer
[
0
]
&
0x08
)
!=
0
)
{
msg_Dbg
(
p_sd
,
"reserved bit incorrectly set"
);
return
VLC_EGENERIC
;
}
if
(
(
p_buffer
[
0
]
&
0x04
)
!=
0
)
if
(
(
p_buffer
[
0
]
&
0x04
)
!=
0
)
{
{
msg_Dbg
(
p_sd
,
"session deletion packet"
);
msg_Dbg
(
p_sd
,
"session deletion packet"
);
...
@@ -692,6 +686,8 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
...
@@ -692,6 +686,8 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
}
}
}
}
char
*
psz_end
;
if
(
b_compressed
)
if
(
b_compressed
)
{
{
#ifdef HAVE_ZLIB_H
#ifdef HAVE_ZLIB_H
...
@@ -701,9 +697,9 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
...
@@ -701,9 +697,9 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
&
p_decompressed_buffer
,
i_read
-
(
psz_sdp
-
(
char
*
)
p_buffer
)
);
&
p_decompressed_buffer
,
i_read
-
(
psz_sdp
-
(
char
*
)
p_buffer
)
);
if
(
i_decompressed_size
>
0
)
if
(
i_decompressed_size
>
0
)
{
{
psz_sdp
=
(
char
*
)
p_decompressed_buffer
;
psz_sdp
=
realloc
(
p_decompressed_buffer
,
i_decompressed_size
+
1
);
realloc
(
p_decompressed_buffer
,
i_decompressed_size
+
1
);
psz_sdp
[
i_decompressed_size
]
=
'\0'
;
psz_sdp
[
i_decompressed_size
]
=
'\0'
;
psz_end
=
psz_sdp
+
i_decompressed_size
;
}
}
else
else
{
{
...
@@ -715,6 +711,8 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
...
@@ -715,6 +711,8 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
#endif
#endif
}
}
else
psz_end
=
((
const
char
*
)
p_buffer
)
+
i_read
;
/* Add the size of authentification info */
/* Add the size of authentification info */
if
(
i_read
<
p_buffer
[
1
]
+
(
psz_sdp
-
psz_initial_sdp
)
)
if
(
i_read
<
p_buffer
[
1
]
+
(
psz_sdp
-
psz_initial_sdp
)
)
...
@@ -744,7 +742,7 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
...
@@ -744,7 +742,7 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
{
{
msg_Dbg
(
p_sd
,
"unhandled content type: %s"
,
psz_foo
);
msg_Dbg
(
p_sd
,
"unhandled content type: %s"
,
psz_foo
);
}
}
if
(
(
psz_sdp
-
(
char
*
)
p_buffer
)
>=
i_rea
d
)
if
(
psz_sdp
>=
psz_en
d
)
{
{
msg_Warn
(
p_sd
,
"package without content"
);
msg_Warn
(
p_sd
,
"package without content"
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
...
...
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