Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15-SP6:Update
pbzip2
pbzip2-fix_unused_result.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pbzip2-fix_unused_result.patch of Package pbzip2
Index: pbzip2.cpp =================================================================== --- pbzip2.cpp.orig +++ pbzip2.cpp @@ -2233,7 +2233,17 @@ int directdecompress(const char *InFilen return ret; } if (nread > 0) - (void) fwrite (obuf, sizeof(unsigned char), nread, stream); + { + if (fwrite (obuf, sizeof(unsigned char), nread, stream) < nread) + { + fprintf(stderr, "pbzip2: *ERROR: Failed to write to output file %s. Aborting!\n", OutFilename); + if (zStream != stdin) + fclose(zStream); + if (stream != stdout) + fclose(stream); + return -1; + } + } if (ferror(stream)) { ret = testBZ2ErrorHandling(bzerr, bzf, streamNo); @@ -2251,7 +2261,17 @@ int directdecompress(const char *InFilen } } if ((bzerr == BZ_OK || bzerr == BZ_STREAM_END) && nread > 0) - (void) fwrite(obuf, sizeof(unsigned char), nread, stream ); + { + if (fwrite(obuf, sizeof(unsigned char), nread, stream ) < nread) + { + fprintf(stderr, "pbzip2: *ERROR: Failed to write to output file %s. Aborting!\n", OutFilename); + if (zStream != stdin) + fclose(zStream); + if (stream != stdout) + fclose(stream); + return -1; + } + } if (ferror(stream)) { ret = testBZ2ErrorHandling(bzerr, bzf, streamNo);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor