X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fhtparser.c;h=07f3dd67daa8b20088f390dd4009b108b487e35d;hb=a06a2fbdf3cd4dc4728c437304478184902e3aa8;hp=5d7a9324cfeef4aa909a366124a0ce6bb4435477;hpb=8cc516344932495129e25d03d5f0850830f3387f;p=ashd.git diff --git a/src/htparser.c b/src/htparser.c index 5d7a932..07f3dd6 100644 --- a/src/htparser.c +++ b/src/htparser.c @@ -365,8 +365,10 @@ static void serve(struct muth *muth, va_list args) */ if((hd = getheader(req, "content-length")) != NULL) { dlen = atoo(hd); - if(dlen > 0) - passdata(fd, cfd, &inbuf, dlen); + if(dlen > 0) { + if(passdata(fd, cfd, &inbuf, dlen) < 0) + goto out; + } } /* Make sure to send EOF */ shutdown(cfd, SHUT_WR); @@ -386,7 +388,8 @@ static void serve(struct muth *muth, va_list args) * Pass the actual output: */ sizebuf(outbuf, 65536); - sent = passdata(cfd, fd, &outbuf, -1); + if((sent = passdata(cfd, fd, &outbuf, -1)) < 0) + goto out; sent -= headoff; /*