]> granicus.if.org Git - php/commitdiff
Fixed bug #39869 (safe_read does not initialize errno). (michiel at boland dot org)
authorDmitry Stogov <dmitry@php.net>
Tue, 19 Dec 2006 09:17:04 +0000 (09:17 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 19 Dec 2006 09:17:04 +0000 (09:17 +0000)
NEWS
sapi/cgi/fastcgi.c

diff --git a/NEWS b/NEWS
index afb8a502ad9247368d8465e9d6f730c47c4dad2e..16bf5a31d1c655235433f852332ea625cb0ce606 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ PHP                                                                        NEWS
   . cookies
   . canary protection (debug build only)
   . random generation of cookies and canaries
+- Fixed bug #39869 (safe_read does not initialize errno).
+  (michiel at boland dot org, Dmitry)
 - Fixed bug #39850 (SplFileObject throws contradictory/wrong error messages 
   when trying to open "php://wrong"). (Tony)
 - Fixed bug #39832 (SOAP Server: parameter not matching the WSDL specified type
index 381e1ddcecb9c001e995250d110e7b483c620169..9b6071f0a62c955d283627df2442bb1cb4e03b88 100644 (file)
@@ -347,6 +347,7 @@ static inline ssize_t safe_write(fcgi_request *req, const void *buf, size_t coun
        size_t n = 0;
 
        do {
+               errno = 0;
                ret = write(req->fd, ((char*)buf)+n, count-n);
                if (ret > 0) {
                        n += ret;
@@ -363,6 +364,7 @@ static inline ssize_t safe_read(fcgi_request *req, const void *buf, size_t count
        size_t n = 0;
 
        do {
+               errno = 0;
                ret = read(req->fd, ((char*)buf)+n, count-n);
                if (ret > 0) {
                        n += ret;