[Buildroot] [PATCH 3/3] package/giflib/0004-Fix-several-defects-found-by-Coverity-scan.patch: New security patch

Yann E. MORIN yann.morin.1998 at free.fr
Mon Dec 18 16:46:10 UTC 2023


Adam, All,

On 2023-12-05 16:59 -0700, Adam Duskett spake thusly:
> Signed-off-by: Adam Duskett <adam.duskett at amarulasolutions.com>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  ...veral-defects-found-by-Coverity-scan.patch | 61 +++++++++++++++++++
>  1 file changed, 61 insertions(+)
>  create mode 100644 package/giflib/0004-Fix-several-defects-found-by-Coverity-scan.patch
> 
> diff --git a/package/giflib/0004-Fix-several-defects-found-by-Coverity-scan.patch b/package/giflib/0004-Fix-several-defects-found-by-Coverity-scan.patch
> new file mode 100644
> index 0000000000..1719769872
> --- /dev/null
> +++ b/package/giflib/0004-Fix-several-defects-found-by-Coverity-scan.patch
> @@ -0,0 +1,61 @@
> +From a1c48b91cd1cf1e9bf7077709b69f4bfd4c4abc7 Mon Sep 17 00:00:00 2001
> +From: Sandro Mani <manisandro at gmail.com>
> +Date: Tue, 5 Dec 2023 16:38:48 -0700
> +Subject: [PATCH] Fix several defects found by Coverity scan
> +
> +From: giflib-5.2.1-17.fc39.src.rpm
> +Upstream: Not submitted
> +
> +Signed-off-by: Sandro Mani <manisandro at gmail.com>
> +Signed-off-by: Adam Duskett <adam.duskett at amarulasolutions.com>
> +---
> + gif2rgb.c | 11 ++++++++++-
> + 1 file changed, 10 insertions(+), 1 deletion(-)
> +
> +diff --git a/gif2rgb.c b/gif2rgb.c
> +index d9a469f..02cea41 100644
> +--- a/gif2rgb.c
> ++++ b/gif2rgb.c
> +@@ -170,6 +170,8 @@ static void SaveGif(GifByteType *OutputBuffer,
> +     /* Open stdout for the output file: */
> +     if ((GifFile = EGifOpenFileHandle(1, &Error)) == NULL) {
> + 	PrintGifError(Error);
> ++	free(OutputBuffer);
> ++	GifFreeMapObject(OutputColorMap);
> + 	exit(EXIT_FAILURE);
> +     }
> + 
> +@@ -179,6 +181,8 @@ static void SaveGif(GifByteType *OutputBuffer,
> + 	EGifPutImageDesc(GifFile,
> + 			 0, 0, Width, Height, false, NULL) == GIF_ERROR) {
> + 	PrintGifError(Error);
> ++	free(OutputBuffer);
> ++	GifFreeMapObject(OutputColorMap);
> + 	exit(EXIT_FAILURE);
> +     }
> + 
> +@@ -187,8 +191,11 @@ static void SaveGif(GifByteType *OutputBuffer,
> + 	       GifFile->Image.Width, GifFile->Image.Height);
> + 
> +     for (i = 0; i < Height; i++) {
> +-	if (EGifPutLine(GifFile, Ptr, Width) == GIF_ERROR)
> ++	if (EGifPutLine(GifFile, Ptr, Width) == GIF_ERROR) {
> ++	    free(OutputBuffer);
> ++	    GifFreeMapObject(OutputColorMap);
> + 	    exit(EXIT_FAILURE);
> ++        }
> + 	GifQprintf("\b\b\b\b%-4d", Height - i - 1);
> + 
> + 	Ptr += Width;
> +@@ -196,6 +203,8 @@ static void SaveGif(GifByteType *OutputBuffer,
> + 
> +     if (EGifCloseFile(GifFile, &Error) == GIF_ERROR) {
> + 	PrintGifError(Error);
> ++	free(OutputBuffer);
> ++	GifFreeMapObject(OutputColorMap);
> + 	exit(EXIT_FAILURE);
> +     }
> + }
> +-- 
> +2.43.0
> +
> -- 
> 2.43.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot at buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'



More information about the buildroot mailing list