Second part of bug fix for 6606.
authorVolker Lendecke <vl@samba.org>
Tue, 15 Sep 2009 02:09:54 +0000 (19:09 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 15 Sep 2009 02:09:54 +0000 (19:09 -0700)
s3:libsmb: Fix bug 6606 -- short reads in smbclient were not handled

source3/libsmb/clireadwrite.c

index b6901961d06cd3875001ac40278b5e3d74b9cd3a..6342de484c206ae1bd1ee0cfdf3bbaaeb1c4da61 100644 (file)
@@ -287,6 +287,12 @@ static void cli_readall_done(struct tevent_req *subreq)
                return;
        }
 
+       if (received == 0) {
+               /* EOF */
+               tevent_req_done(req);
+               return;
+       }
+
        if ((state->received == 0) && (received == state->size)) {
                /* Ideal case: Got it all in one run */
                state->buf = buf;