vcs-svn: verify that deltas consume all inline data
By constraining the format of deltas, we can more easily detect corruption and other breakage. Requiring deltas not to provide unconsumed data also opens the possibility of ignoring the declared amount of novel data and simply streaming the data as needed to fulfill copyfrom_data requests. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Ramkumar Ramachandra <artagnon@gmail.com>
This commit is contained in:
@ -208,6 +208,8 @@ static int apply_window_in_core(struct window *ctx)
|
||||
)
|
||||
if (execute_one_instruction(ctx, &instructions, &data_pos))
|
||||
return -1;
|
||||
if (data_pos != ctx->data.len)
|
||||
return error("invalid delta: does not copy all inline data");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user