fix NULL dereference in 'got clone' if server sends an empty pack file
diff --git a/got/got.c b/got/got.c
index 2bf465e..9e4617d 100644
--- a/got/got.c
+++ b/got/got.c
@@ -1658,6 +1658,11 @@ cmd_clone(int argc, char *argv[])
goto done;
}
+ if (pack_hash == NULL) {
+ error = got_error_fmt(GOT_ERR_FETCH_FAILED, "%s",
+ "server sent an empty pack file");
+ goto done;
+ }
error = got_object_id_str(&id_str, pack_hash);
if (error)
goto done;