diff options
author | Jonathan Cowper-Andrewes <Jonathan.Ca@Sun.COM> | 2009-03-30 22:19:54 +0100 |
---|---|---|
committer | Jonathan Cowper-Andrewes <Jonathan.Ca@Sun.COM> | 2009-03-30 22:19:54 +0100 |
commit | a5669307eaef64af8519feb70d42f0aa0e7ec21a (patch) | |
tree | ac510b901e30abae5b6f348320f6cab85ca361ac /usr/src/lib/print/libpapi-ipp/common/ipp-support.c | |
parent | becf5de312dcd786fe98ed1f17cfb64004fb2551 (diff) | |
download | illumos-gate-a5669307eaef64af8519feb70d42f0aa0e7ec21a.tar.gz |
6799615 return from stat() should be checked when looking for zero byte files
Diffstat (limited to 'usr/src/lib/print/libpapi-ipp/common/ipp-support.c')
-rw-r--r-- | usr/src/lib/print/libpapi-ipp/common/ipp-support.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr/src/lib/print/libpapi-ipp/common/ipp-support.c b/usr/src/lib/print/libpapi-ipp/common/ipp-support.c index ab3d1a337c..bbdf867b12 100644 --- a/usr/src/lib/print/libpapi-ipp/common/ipp-support.c +++ b/usr/src/lib/print/libpapi-ipp/common/ipp-support.c @@ -536,7 +536,12 @@ ipp_send_request_with_file(service_t *svc, papi_attribute_t **request, detailed_error(svc, "%s: %s", file, strerror(errno)); return (PAPI_DOCUMENT_ACCESS_ERROR); } else if (strcmp("standard input", file) != 0) { - stat(file, &statbuf); + if (stat(file, &statbuf) < 0) { + detailed_error(svc, + gettext("Cannot access file: %s: %s"), + file, strerror(errno)); + return (PAPI_DOCUMENT_ACCESS_ERROR); + } if (statbuf.st_size == 0) { detailed_error(svc, "Zero byte (empty) file: %s", file); |