diff options
author | jbeich <jbeich@FreeBSD.org> | 2017-10-27 03:04:42 +0800 |
---|---|---|
committer | jbeich <jbeich@FreeBSD.org> | 2017-10-27 03:04:42 +0800 |
commit | 44bff8e52e726f42f0c0f4735d6da2a97e0fe738 (patch) | |
tree | b9431fd1de4e6a698c6278d25e685e55646d31f0 | |
parent | c6a6968a886ef22fca0a4e2845abae30ca7e74fc (diff) | |
download | freebsd-ports-gnome-44bff8e52e726f42f0c0f4735d6da2a97e0fe738.tar.gz freebsd-ports-gnome-44bff8e52e726f42f0c0f4735d6da2a97e0fe738.tar.zst freebsd-ports-gnome-44bff8e52e726f42f0c0f4735d6da2a97e0fe738.zip |
graphics/sdl_image: backport XCF vulnerability fix
Obtained from: upstream (SDL_image-2.0.2)
Security: CVE-2017-2887
Tested by: Debian
-rw-r--r-- | graphics/sdl_image/Makefile | 2 | ||||
-rw-r--r-- | graphics/sdl_image/files/patch-IMG__xcf.c | 27 |
2 files changed, 28 insertions, 1 deletions
diff --git a/graphics/sdl_image/Makefile b/graphics/sdl_image/Makefile index a7727e8a4b0d..514b488c9600 100644 --- a/graphics/sdl_image/Makefile +++ b/graphics/sdl_image/Makefile @@ -3,7 +3,7 @@ PORTNAME= sdl_image PORTVERSION= 1.2.12 -PORTREVISION= 10 +PORTREVISION= 11 CATEGORIES= graphics MASTER_SITES= http://www.libsdl.org/projects/SDL_image/release/ DISTNAME= SDL_image-${PORTVERSION} diff --git a/graphics/sdl_image/files/patch-IMG__xcf.c b/graphics/sdl_image/files/patch-IMG__xcf.c new file mode 100644 index 000000000000..56226b476c96 --- /dev/null +++ b/graphics/sdl_image/files/patch-IMG__xcf.c @@ -0,0 +1,27 @@ +Fixed security vulnerability in XCF image loader (thanks Yves!) +https://hg.libsdl.org/SDL_image/rev/318484db0705 + +--- IMG_xcf.c.orig 2012-01-21 01:51:33 UTC ++++ IMG_xcf.c +@@ -251,6 +251,7 @@ static Uint32 Swap32 (Uint32 v) { + } + + static void xcf_read_property (SDL_RWops * src, xcf_prop * prop) { ++ Uint32 len; + prop->id = SDL_ReadBE32 (src); + prop->length = SDL_ReadBE32 (src); + +@@ -274,7 +275,12 @@ static void xcf_read_property (SDL_RWops * src, xcf_pr + break; + case PROP_COMPRESSION: + case PROP_COLOR: +- SDL_RWread (src, &prop->data, prop->length, 1); ++ if (prop->length > sizeof(prop->data)) { ++ len = sizeof(prop->data); ++ } else { ++ len = prop->length; ++ } ++ SDL_RWread(src, &prop->data, len, 1); + break; + case PROP_VISIBLE: + prop->data.visible = SDL_ReadBE32 (src); |