diff options
| author | 2026-04-10 12:21:17 +0200 | |
|---|---|---|
| committer | 2026-04-10 12:21:17 +0200 | |
| commit | 9dfcfe8dc22233cb08aa22ba743640d8db92c4e7 (patch) | |
| tree | 12020050e429f5acac7473301838fd3895c9312b /tools/plistutil.c | |
| parent | f41b1ea67045e0c09339974d83e389972d84f166 (diff) | |
| download | libplist-9dfcfe8dc22233cb08aa22ba743640d8db92c4e7.tar.gz libplist-9dfcfe8dc22233cb08aa22ba743640d8db92c4e7.tar.bz2 | |
Fix fread() unused return values by actually handling errors
Diffstat (limited to 'tools/plistutil.c')
| -rw-r--r-- | tools/plistutil.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/plistutil.c b/tools/plistutil.c index 95ec254..37bb044 100644 --- a/tools/plistutil.c +++ b/tools/plistutil.c @@ -337,6 +337,13 @@ int main(int argc, char *argv[]) return 1; } read_size = fread(plist_entire, sizeof(char), filestats.st_size, iplist); + if (read_size != (size_t)filestats.st_size) { + fprintf(stderr, "ERROR: Could not read from input file '%s'\n", options->in_file); + fclose(iplist); + free(plist_entire); + free(options); + return 1; + } plist_entire[read_size] = '\0'; fclose(iplist); } |
