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
a4563ffe
Commit
a4563ffe
authored
Nov 09, 2016
by
Filippo Bigarella
Committed by
Nikias Bassen
Nov 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bplist: Fix possible out-of-bounds read in parse_dict_node() with proper bounds checking
parent
17b8e01b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
bplist.c
src/bplist.c
+13
-2
No files found.
src/bplist.c
View file @
a4563ffe
...
...
@@ -402,6 +402,9 @@ static plist_t parse_dict_node(struct bplist_data *bplist, const char** bnode, u
uint64_t
str_i
=
0
,
str_j
=
0
;
uint64_t
index1
,
index2
;
plist_data_t
data
=
plist_new_plist_data
();
const
char
*
const
end_data
=
bplist
->
data
+
bplist
->
size
;
const
char
*
index1_ptr
=
NULL
;
const
char
*
index2_ptr
=
NULL
;
data
->
type
=
PLIST_DICT
;
data
->
length
=
size
;
...
...
@@ -411,9 +414,17 @@ static plist_t parse_dict_node(struct bplist_data *bplist, const char** bnode, u
for
(
j
=
0
;
j
<
data
->
length
;
j
++
)
{
str_i
=
j
*
bplist
->
dict_size
;
str_j
=
(
j
+
size
)
*
bplist
->
dict_size
;
index1_ptr
=
(
*
bnode
)
+
str_i
;
index2_ptr
=
(
*
bnode
)
+
str_j
;
index1
=
UINT_TO_HOST
((
*
bnode
)
+
str_i
,
bplist
->
dict_size
);
index2
=
UINT_TO_HOST
((
*
bnode
)
+
str_j
,
bplist
->
dict_size
);
if
((
index1_ptr
<
bplist
->
data
||
index1_ptr
+
bplist
->
dict_size
>=
end_data
)
||
(
index2_ptr
<
bplist
->
data
||
index2_ptr
+
bplist
->
dict_size
>=
end_data
))
{
plist_free
(
node
);
return
NULL
;
}
index1
=
UINT_TO_HOST
(
index1_ptr
,
bplist
->
dict_size
);
index2
=
UINT_TO_HOST
(
index2_ptr
,
bplist
->
dict_size
);
if
(
index1
>=
bplist
->
num_objects
)
{
plist_free
(
node
);
...
...
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