summaryrefslogtreecommitdiff
path: root/source3/web/cgi.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/web/cgi.c')
-rw-r--r--source3/web/cgi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/web/cgi.c b/source3/web/cgi.c
index 49e83717c3..40f9ee6966 100644
--- a/source3/web/cgi.c
+++ b/source3/web/cgi.c
@@ -498,7 +498,9 @@ static void cgi_download(char *file)
printf("Content-Length: %d\r\n\r\n", (int)st.st_size);
while ((l=read(fd,buf,sizeof(buf)))>0) {
- fwrite(buf, 1, l, stdout);
+ if (fwrite(buf, 1, l, stdout) != l) {
+ break;
+ }
}
close(fd);
exit(0);