Handle error case.
Found by clang static analyzer.
diff --git a/lib/zip_source_crc.c b/lib/zip_source_crc.c
index d84c3e7..1ef20f7 100644
--- a/lib/zip_source_crc.c
+++ b/lib/zip_source_crc.c
@@ -176,9 +176,12 @@
case ZIP_SOURCE_SEEK:
{
- zip_source_args_seek_t *args = ZIP_SOURCE_GET_ARGS(zip_source_args_seek_t, data, len, &ctx->error);
zip_int64_t new_position;
+ zip_source_args_seek_t *args = ZIP_SOURCE_GET_ARGS(zip_source_args_seek_t, data, len, &ctx->error);
+ if (args == NULL) {
+ return -1;
+ }
if (zip_source_seek(src, args->offset, args->whence) < 0 || (new_position = zip_source_tell(src)) < 0) {
_zip_error_set_from_source(&ctx->error, src);
return -1;