Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libplist
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pwn
libplist
Commits
1ae55728
Commit
1ae55728
authored
Nov 10, 2016
by
Filippo Bigarella
Committed by
Nikias Bassen
Nov 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bplist: Make sure the index in parse_bin_node_at_index() is actually within the offset table
parent
b86a392b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
bplist.c
src/bplist.c
+13
-4
No files found.
src/bplist.c
View file @
1ae55728
...
...
@@ -661,11 +661,20 @@ static plist_t parse_bin_node(struct bplist_data *bplist, const char** object)
static
plist_t
parse_bin_node_at_index
(
struct
bplist_data
*
bplist
,
uint32_t
node_index
)
{
int
i
;
const
char
*
ptr
;
plist_t
plist
;
int
i
=
0
;
const
char
*
ptr
=
NULL
;
plist_t
plist
=
NULL
;
const
char
*
idx_ptr
=
NULL
;
if
(
node_index
>
bplist
->
num_objects
)
return
NULL
;
idx_ptr
=
bplist
->
offset_table
+
node_index
*
bplist
->
offset_size
;
if
(
idx_ptr
<
bplist
->
offset_table
||
idx_ptr
>=
bplist
->
offset_table
+
bplist
->
num_objects
*
bplist
->
offset_size
)
return
NULL
;
ptr
=
bplist
->
data
+
UINT_TO_HOST
(
bplist
->
offset_table
+
node_index
*
bplist
->
offset_size
,
bplist
->
offset_size
);
ptr
=
bplist
->
data
+
UINT_TO_HOST
(
idx_ptr
,
bplist
->
offset_size
);
/* make sure the node offset is in a sane range */
if
((
ptr
<
bplist
->
data
)
||
(
ptr
>=
bplist
->
offset_table
))
{
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