Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8cc5163
)
Check the output from passdata in htparser.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Wed, 31 Dec 2008 10:22:13 +0000
(11:22 +0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Wed, 31 Dec 2008 10:22:13 +0000
(11:22 +0100)
src/htparser.c
patch
|
blob
|
blame
|
history
diff --git
a/src/htparser.c
b/src/htparser.c
index
5d7a932
..
07f3dd6
100644
(file)
--- 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;
/*