Files
Limine/decompressor/tinf.patch

55 lines
1.4 KiB
Diff

--- tinf-clean/tinfgzip.c 2026-03-31 13:52:17.360241095 +0200
+++ decompressor/tinf/tinfgzip.c 2026-03-31 14:00:21.885490126 +0200
@@ -101,7 +101,7 @@
/* Skip file name if present */
if (flg & FNAME) {
do {
- if (start - src >= sourceLen) {
+ if (((unsigned int)(start - src)) >= sourceLen) {
return TINF_DATA_ERROR;
}
} while (*start++);
@@ -110,7 +110,7 @@
/* Skip file comment if present */
if (flg & FCOMMENT) {
do {
- if (start - src >= sourceLen) {
+ if (((unsigned int)(start - src)) >= sourceLen) {
return TINF_DATA_ERROR;
}
} while (*start++);
@@ -120,7 +120,7 @@
if (flg & FHCRC) {
unsigned int hcrc;
- if (start - src > sourceLen - 2) {
+ if ((unsigned int)(start - src) > sourceLen - 2) {
return TINF_DATA_ERROR;
}
--- tinf-clean/tinflate.c 2026-03-31 13:52:17.360241095 +0200
+++ decompressor/tinf/tinflate.c 2026-03-31 14:03:04.603900859 +0200
@@ -25,7 +25,7 @@
#include "tinf.h"
-#include <assert.h>
+#define assert(...)
#include <limits.h>
#if defined(UINT_MAX) && (UINT_MAX) < 0xFFFFFFFFUL
@@ -501,11 +501,11 @@
d->source += 4;
- if (d->source_end - d->source < length) {
+ if ((unsigned int)(d->source_end - d->source) < length) {
return TINF_DATA_ERROR;
}
- if (d->dest_end - d->dest < length) {
+ if ((unsigned int)(d->dest_end - d->dest) < length) {
return TINF_BUF_ERROR;
}