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
66932417
Commit
66932417
authored
Jan 28, 2015
by
Nikias Bassen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plistutil: Use static buffer for stat()
parent
801a72a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
plistutil.c
tools/plistutil.c
+4
-6
No files found.
tools/plistutil.c
View file @
66932417
...
...
@@ -112,13 +112,12 @@ int main(int argc, char *argv[])
uint32_t
size
=
0
;
int
read_size
=
0
;
char
*
plist_entire
=
NULL
;
struct
stat
*
filestats
=
(
struct
stat
*
)
malloc
(
sizeof
(
struct
stat
))
;
struct
stat
filestats
;
options_t
*
options
=
parse_arguments
(
argc
,
argv
);
if
(
!
options
)
{
print_usage
(
argc
,
argv
);
free
(
filestats
);
return
0
;
}
...
...
@@ -127,9 +126,9 @@ int main(int argc, char *argv[])
if
(
!
iplist
)
return
1
;
stat
(
options
->
in_file
,
filestats
);
plist_entire
=
(
char
*
)
malloc
(
sizeof
(
char
)
*
(
filestats
->
st_size
+
1
));
read_size
=
fread
(
plist_entire
,
sizeof
(
char
),
filestats
->
st_size
,
iplist
);
stat
(
options
->
in_file
,
&
filestats
);
plist_entire
=
(
char
*
)
malloc
(
sizeof
(
char
)
*
(
filestats
.
st_size
+
1
));
read_size
=
fread
(
plist_entire
,
sizeof
(
char
),
filestats
.
st_size
,
iplist
);
fclose
(
iplist
);
// convert from binary to xml or vice-versa
...
...
@@ -145,7 +144,6 @@ int main(int argc, char *argv[])
}
plist_free
(
root_node
);
free
(
plist_entire
);
free
(
filestats
);
if
(
plist_out
)
{
...
...
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