mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-10-22 05:44:17 -04:00
In read_sum_head(): if we read a negative checksum count, die
with an error.
This commit is contained in:
1 parent
d775372a34
commit
c638caa63e
1 file changed
+5
@@ -948,6 +948,11 @@ int read_vstring(int f, char *buf, int bufsize)
|
||||
void read_sum_head(int f, struct sum_struct *sum)
|
||||
{
|
||||
sum->count = read_int(f);
|
||||
if (sum->count < 0) {
|
||||
rprintf(FERROR, "Invalid checksum count %ld [%s]\n",
|
||||
(long)sum->count, who_am_i());
|
||||
exit_cleanup(RERR_PROTOCOL);
|
||||
}
|
||||
sum->blength = read_int(f);
|
||||
if (sum->blength < 0 || sum->blength > MAX_BLOCK_SIZE) {
|
||||
rprintf(FERROR, "Invalid block length %ld [%s]\n",
|
||||
|
||||
Reference in new issue
Block a user