From e92d0abecfb11884e85a53f81966c66e5319942d Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 23 Nov 2009 17:02:20 +0000 Subject: Use NetBSD fix for CVE-2009-0689 security vulnerability. * libc/include/sys/reent.h (_Kmax): Define here based on the sizeof size_t, as in latest NetBSD. * libc/reent/reent.c (_reclaim_reent): Use _Kmax rather than constant value 15. * libc/stdlib/mprec.c (_Kmax): Don't define here. Explain why. --- newlib/libc/include/sys/reent.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'newlib/libc/include/sys/reent.h') diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h index 60eb208a7..ed3d9aa01 100644 --- a/newlib/libc/include/sys/reent.h +++ b/newlib/libc/include/sys/reent.h @@ -800,6 +800,11 @@ struct _reent #endif /* !_REENT_SMALL */ +/* This value is used in stdlib/misc.c. reent/reent.c has to know it + as well to make sure the freelist is correctly free'd. Therefore + we define it here, rather than in stdlib/misc.c, as before. */ +#define _Kmax (sizeof (size_t) << 3) + /* * All references to struct _reent are via this pointer. * Internally, newlib routines that need to reference it should use _REENT. -- cgit v1.2.3