openbsd-ports/graphics/lcms/patches/patch-include_lcms_h
jasper 1601d3234d - update lcms to 1.18
* includes security fixes for CVE-2009-0581, CVE-2009-0723 and CVE-2009-0733.
(which could cause a memory leak, buffer overflows and code execution)

ok ajacoutot@
2009-04-09 13:10:49 +00:00

33 lines
939 B
Plaintext

$OpenBSD: patch-include_lcms_h,v 1.8 2009/04/09 13:10:49 jasper Exp $
--- include/lcms.h.orig Thu Apr 9 13:56:40 2009
+++ include/lcms.h Thu Apr 9 13:59:19 2009
@@ -143,17 +143,17 @@ typedef pthread_rwlock_t LCMS_RWLOCK_T;
# define USE_BIG_ENDIAN 1
#endif
-#if TARGET_CPU_PPC
+#if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC
# define USE_BIG_ENDIAN 1
#endif
-#if macintosh
+#if defined(macintosh) && macintosh
# ifndef __LITTLE_ENDIAN__
# define USE_BIG_ENDIAN 1
# endif
#endif
-#ifdef __BIG_ENDIAN__
+#if defined(__BIG_ENDIAN__) && __BIG_ENDIAN__
# define USE_BIG_ENDIAN 1
#endif
@@ -1415,7 +1415,6 @@ LCMS_INLINE WORD _cmsClampWord(int in)
LCMS_INLINE void* _cmsMalloc(size_t size)
{
if (size > ((size_t) 1024*1024*500)) return NULL; // Never allow over 500Mb
- if (size < 0) return NULL; // Prevent signed size_t exploits
return (void*) malloc(size);
}