mirror of
https://github.com/samba-team/samba.git
synced 2025-02-04 17:47:26 +03:00
r9389: handle errors reading from files in web server
bug found by coverity (This used to be commit 1a3229777adf12f8148267af7b33689ebe880ed8)
This commit is contained in:
parent
71f34f401e
commit
b60ef4ee09
@ -153,13 +153,14 @@ static void websrv_send(struct stream_connection *conn, uint16_t flags)
|
||||
web->output.nsent = 0;
|
||||
|
||||
nread = read(web->output.fd, buf, sizeof(buf));
|
||||
if (nread == 0) {
|
||||
close(web->output.fd);
|
||||
web->output.fd = -1;
|
||||
}
|
||||
if (nread == -1 && errno == EINTR) {
|
||||
return;
|
||||
}
|
||||
if (nread <= 0) {
|
||||
close(web->output.fd);
|
||||
web->output.fd = -1;
|
||||
nread = 0;
|
||||
}
|
||||
web->output.content = data_blob_talloc(web, buf, nread);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user