Minor security fixes

This commit is contained in:
Sean Purcell
2017-02-01 10:41:04 -08:00
parent 92ec2ea62f
commit 823d8c233b
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ int main(int argc, char **argv) {
}
size_t decompressed =
ZSTD_decompress_with_dict(output, input_size * MAX_COMPRESSION_RATIO,
ZSTD_decompress_with_dict(output, decompressed_size,
input, input_size, dict, dict_size);
write_file(argv[2], output, decompressed);
@@ -1331,6 +1331,8 @@ static void execute_sequences(io_streams_t *const streams,
}
match_length -= dict_copy;
}
} else if (offset > ctx->header.window_size) {
CORRUPTION();
}
// We must copy byte by byte because the match length might be larger