Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libdvbpsi
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
libdvbpsi
Commits
680a990f
Commit
680a990f
authored
Mar 20, 2013
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dr_48: add boundary checking
parent
86d5fe68
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
src/descriptors/dr_48.c
src/descriptors/dr_48.c
+13
-2
No files found.
src/descriptors/dr_48.c
View file @
680a990f
...
...
@@ -61,7 +61,7 @@ dvbpsi_service_dr_t * dvbpsi_DecodeServiceDr(
/* Allocate memory */
dvbpsi_service_dr_t
*
p_decoded
;
p_decoded
=
(
dvbpsi_service_dr_t
*
)
malloc
(
sizeof
(
dvbpsi_service_dr_t
));
p_decoded
=
(
dvbpsi_service_dr_t
*
)
calloc
(
1
,
sizeof
(
dvbpsi_service_dr_t
));
if
(
!
p_decoded
)
return
NULL
;
...
...
@@ -73,6 +73,9 @@ dvbpsi_service_dr_t * dvbpsi_DecodeServiceDr(
p_decoded
->
i_service_provider_name
[
0
]
=
0
;
p_decoded
->
i_service_name
[
0
]
=
0
;
if
(
p_decoded
->
i_service_provider_name_length
>
252
)
p_decoded
->
i_service_provider_name_length
=
252
;
if
(
p_decoded
->
i_service_provider_name_length
+
2
>
p_descriptor
->
i_length
)
return
p_decoded
;
...
...
@@ -87,6 +90,9 @@ dvbpsi_service_dr_t * dvbpsi_DecodeServiceDr(
p_decoded
->
i_service_name_length
=
p_descriptor
->
p_data
[
2
+
p_decoded
->
i_service_provider_name_length
];
if
(
p_decoded
->
i_service_name_length
>
252
)
p_decoded
->
i_service_name_length
=
252
;
if
(
p_decoded
->
i_service_provider_name_length
+
3
+
p_decoded
->
i_service_name_length
>
p_descriptor
->
i_length
)
return
p_decoded
;
...
...
@@ -105,10 +111,15 @@ dvbpsi_service_dr_t * dvbpsi_DecodeServiceDr(
dvbpsi_descriptor_t
*
dvbpsi_GenServiceDr
(
dvbpsi_service_dr_t
*
p_decoded
,
bool
b_duplicate
)
{
if
(
p_decoded
->
i_service_provider_name_length
>
252
)
p_decoded
->
i_service_provider_name_length
=
252
;
if
(
p_decoded
->
i_service_name_length
>
252
)
p_decoded
->
i_service_name_length
=
252
;
/* Create the descriptor */
dvbpsi_descriptor_t
*
p_descriptor
=
dvbpsi_NewDescriptor
(
0x48
,
3
+
p_decoded
->
i_service_name_length
+
p_decoded
->
i_service_provider_name_length
,
NULL
);
p_decoded
->
i_service_provider_name_length
,
NULL
);
if
(
!
p_descriptor
)
return
NULL
;
...
...
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