diff options
Diffstat (limited to 'freebsd/dependencies/imlib')
-rw-r--r-- | freebsd/dependencies/imlib/files/patch-fix-potential-buffer-overflow.diff | 19 | ||||
-rw-r--r-- | freebsd/dependencies/imlib/files/patch-giflib5.1.diff | 50 |
2 files changed, 69 insertions, 0 deletions
diff --git a/freebsd/dependencies/imlib/files/patch-fix-potential-buffer-overflow.diff b/freebsd/dependencies/imlib/files/patch-fix-potential-buffer-overflow.diff new file mode 100644 index 000000000..406aead10 --- /dev/null +++ b/freebsd/dependencies/imlib/files/patch-fix-potential-buffer-overflow.diff @@ -0,0 +1,19 @@ +Index: b/Imlib/load.c +=================================================================== +--- a/Imlib/load.c ++++ b/Imlib/load.c +@@ -1974,11 +1974,11 @@ + if (iden[0]) + { + #ifndef __EMX__ +- strncat(fil, ":", sizeof(fil) - strlen(fil)); ++ strncat(fil, ":", sizeof(fil) - strlen(fil) - 1); + #else +- strncat(fil, ";", sizeof(fil) - strlen(fil)); ++ strncat(fil, ";", sizeof(fil) - strlen(fil) - 1); + #endif +- strncat(fil, iden, sizeof(fil) - strlen(fil)); ++ strncat(fil, iden, sizeof(fil) - strlen(fil) - 1); + } + } + im->mod.gamma = id->mod.gamma; diff --git a/freebsd/dependencies/imlib/files/patch-giflib5.1.diff b/freebsd/dependencies/imlib/files/patch-giflib5.1.diff new file mode 100644 index 000000000..fddd984fc --- /dev/null +++ b/freebsd/dependencies/imlib/files/patch-giflib5.1.diff @@ -0,0 +1,50 @@ +Index: imlib-1.9.15/Imlib/load.c +=================================================================== +--- imlib-1.9.15.orig/Imlib/load.c ++++ imlib-1.9.15/Imlib/load.c +@@ -489,13 +489,21 @@ _LoadGIF(ImlibData * id, FILE *f, int *w + rows = malloc(*h * sizeof(GifRowType *)); + if (!rows) + { ++#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) ++ DGifCloseFile(gif, NULL); ++#else + DGifCloseFile(gif); ++#endif + return NULL; + } + data = _imlib_malloc_image(*w, *h); + if (!data) + { ++#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) ++ DGifCloseFile(gif, NULL); ++#else + DGifCloseFile(gif); ++#endif + free(rows); + return NULL; + } +@@ -506,7 +514,11 @@ _LoadGIF(ImlibData * id, FILE *f, int *w + rows[i] = malloc(*w * sizeof(GifPixelType)); + if (!rows[i]) + { ++#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) ++ DGifCloseFile(gif, NULL); ++#else + DGifCloseFile(gif); ++#endif + for (i = 0; i < *h; i++) + if (rows[i]) + free(rows[i]); +@@ -595,7 +607,11 @@ _LoadGIF(ImlibData * id, FILE *f, int *w + } + } + } ++#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) ++ DGifCloseFile(gif, NULL); ++#else + DGifCloseFile(gif); ++#endif + for (i = 0; i < *h; i++) + free(rows[i]); + free(rows); |