Commit Diff


commit - 789899c8e706b0688fa908fd0c36a423bd8228c6
commit + 82031ac84c8cf40b9d7373d07cf94423b8a7bf22
blob - 1c0dca5988508ef04d6a7e98660101631596d8bb
blob + fd881a7c9ce48fda7e1c9997d71b47a93bba6268
--- lib/pack.c
+++ lib/pack.c
@@ -1781,8 +1781,10 @@ read_raw_delta_data(uint8_t **delta_buf, size_t *delta
 		goto done;
 	}
 	if (pack->map) {
-		if (delta_data_offset >= pack->filesize)
+		if (delta_data_offset >= pack->filesize) {
 			err = got_error(GOT_ERR_PACK_OFFSET);
+			goto done;
+		}
 		memcpy(*delta_buf, pack->map + delta_data_offset,
 		    *delta_len_compressed);
 	} else {