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
4765d9a6
Commit
4765d9a6
authored
8 years ago
by
Nikias Bassen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bplist: Fix possible out-of-bounds read in parse_array_node() with proper bounds checking
parent
5791fb90
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
bplist.c
src/bplist.c
+12
-4
No files found.
src/bplist.c
View file @
4765d9a6
...
@@ -447,10 +447,11 @@ static plist_t parse_dict_node(struct bplist_data *bplist, const char** bnode, u
...
@@ -447,10 +447,11 @@ static plist_t parse_dict_node(struct bplist_data *bplist, const char** bnode, u
static
plist_t
parse_array_node
(
struct
bplist_data
*
bplist
,
const
char
**
bnode
,
uint64_t
size
)
static
plist_t
parse_array_node
(
struct
bplist_data
*
bplist
,
const
char
**
bnode
,
uint64_t
size
)
{
{
uint64_t
j
;
uint64_t
j
;
uint32_t
str_j
=
0
;
uint64_t
str_j
=
0
;
uint32_t
index1
;
uint64_t
index1
;
plist_data_t
data
=
plist_new_plist_data
();
plist_data_t
data
=
plist_new_plist_data
();
const
char
*
const
end_data
=
bplist
->
data
+
bplist
->
size
;
const
char
*
index1_ptr
=
NULL
;
data
->
type
=
PLIST_ARRAY
;
data
->
type
=
PLIST_ARRAY
;
data
->
length
=
size
;
data
->
length
=
size
;
...
@@ -459,7 +460,14 @@ static plist_t parse_array_node(struct bplist_data *bplist, const char** bnode,
...
@@ -459,7 +460,14 @@ static plist_t parse_array_node(struct bplist_data *bplist, const char** bnode,
for
(
j
=
0
;
j
<
data
->
length
;
j
++
)
{
for
(
j
=
0
;
j
<
data
->
length
;
j
++
)
{
str_j
=
j
*
bplist
->
ref_size
;
str_j
=
j
*
bplist
->
ref_size
;
index1
=
UINT_TO_HOST
((
*
bnode
)
+
str_j
,
bplist
->
ref_size
);
index1_ptr
=
(
*
bnode
)
+
str_j
;
if
(
index1_ptr
<
bplist
->
data
||
index1_ptr
+
bplist
->
ref_size
>=
end_data
)
{
plist_free
(
node
);
return
NULL
;
}
index1
=
UINT_TO_HOST
(
index1_ptr
,
bplist
->
ref_size
);
if
(
index1
>=
bplist
->
num_objects
)
{
if
(
index1
>=
bplist
->
num_objects
)
{
plist_free
(
node
);
plist_free
(
node
);
...
...
This diff is collapsed.
Click to expand it.
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