mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-21 10:50:24 +03:00
phypUUIDTable_Push: do not corrupt output stream upon partial write
* src/phyp/phyp_driver.c (phypUUIDTable_Push): Move incr/decr of ptr/nread into the loop where those variables are used. Also, remove "exit" label and just-preceding "goto".
This commit is contained in:
parent
77d118b4ce
commit
23e93d95b5
@ -2002,14 +2002,11 @@ phypUUIDTable_Push(virConnectPtr conn)
|
||||
/* rc indicates how many bytes were written this time */
|
||||
sent += rc;
|
||||
}
|
||||
ptr += sent;
|
||||
nread -= sent;
|
||||
} while (rc > 0 && sent < nread);
|
||||
ptr += sent;
|
||||
nread -= sent;
|
||||
} while (1);
|
||||
|
||||
goto exit;
|
||||
|
||||
exit:
|
||||
if (channel) {
|
||||
libssh2_channel_send_eof(channel);
|
||||
libssh2_channel_wait_eof(channel);
|
||||
|
Loading…
x
Reference in New Issue
Block a user