Commit c638caa6 authored by Wayne Davison's avatar Wayne Davison

In read_sum_head(): if we read a negative checksum count, die

with an error.
parent d775372a
......@@ -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",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment