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
eb929319
Commit
eb929319
authored
8 years ago
by
Nikias Bassen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plistutil: Print error message when opening input/output file fails and plug memory leaks on error
parent
cf9ee441
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
plistutil.c
tools/plistutil.c
+7
-1
No files found.
tools/plistutil.c
View file @
eb929319
...
...
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <errno.h>
#ifdef _MSC_VER
#pragma warning(disable:4996)
...
...
@@ -124,14 +125,18 @@ int main(int argc, char *argv[])
// read input file
iplist
=
fopen
(
options
->
in_file
,
"rb"
);
if
(
!
iplist
)
{
printf
(
"ERROR: Could not open input file '%s': %s
\n
"
,
options
->
in_file
,
strerror
(
errno
));
free
(
options
);
return
1
;
}
stat
(
options
->
in_file
,
&
filestats
);
memset
(
&
filestats
,
'\0'
,
sizeof
(
struct
stat
));
fstat
(
fileno
(
iplist
),
&
filestats
);
if
(
filestats
.
st_size
<
8
)
{
printf
(
"ERROR: Input file is too small to contain valid plist data.
\n
"
);
free
(
options
);
fclose
(
iplist
);
return
-
1
;
}
...
...
@@ -159,6 +164,7 @@ int main(int argc, char *argv[])
{
FILE
*
oplist
=
fopen
(
options
->
out_file
,
"wb"
);
if
(
!
oplist
)
{
printf
(
"ERROR: Could not open output file '%s': %s
\n
"
,
options
->
out_file
,
strerror
(
errno
));
free
(
options
);
return
1
;
}
...
...
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