<div dir="ltr">I was asking you about the CVE number (but I realize it was already merged in other branches with wrong number so maybe it will be less confusing use the same in Dizzy)<div><br></div><div>And &quot;please merge&quot; was informal</div><div>Acked-by: Martin Jansa &lt;<a href="mailto:Martin.Jansa@gmail.com">Martin.Jansa@gmail.com</a>&gt;</div><div><br></div><div>after testing this series in our Dizzy based builds.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 3, 2016 at 9:35 PM, akuster@mvista <span dir="ltr">&lt;<a href="mailto:akuster@mvista.com" target="_blank">akuster@mvista.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 3/3/16 12:16 AM, Martin Jansa wrote:<br>
&gt; On Sun, Feb 28, 2016 at 10:53:34AM -0800, Armin Kuster wrote:<br>
&gt;&gt; From: Armin Kuster &lt;<a href="mailto:akuster@mvista.com">akuster@mvista.com</a>&gt;<br>
&gt;<br>
&gt; I think this is 2014-9761 not 2015-9761<br>
&gt;<br>
&gt; But other than that please merge this series.<br>
<br>
</span>Are you asking me? I don&#39;t have write perms.<br>
<br>
- armin<br>
<div class="HOEnZb"><div class="h5">&gt;<br>
&gt;&gt; A stack overflow vulnerability was found in nan* functions that could cause<br>
&gt;&gt; applications which process long strings with the nan function to crash or,<br>
&gt;&gt; potentially, execute arbitrary code.<br>
&gt;&gt;<br>
&gt;&gt; (From OE-Core rev: fd3da8178c8c06b549dbc19ecec40e98ab934d49)<br>
&gt;&gt;<br>
&gt;&gt; Signed-off-by: Armin Kuster &lt;<a href="mailto:akuster@mvista.com">akuster@mvista.com</a>&gt;<br>
&gt;&gt; Signed-off-by: Robert Yang &lt;<a href="mailto:liezhi.yang@windriver.com">liezhi.yang@windriver.com</a>&gt;<br>
&gt;&gt; Signed-off-by: Richard Purdie &lt;<a href="mailto:richard.purdie@linuxfoundation.org">richard.purdie@linuxfoundation.org</a>&gt;<br>
&gt;&gt; Signed-off-by: Armin Kuster &lt;<a href="mailto:akuster@mvista.com">akuster@mvista.com</a>&gt;<br>
&gt;&gt; Signed-off-by: Richard Purdie &lt;<a href="mailto:richard.purdie@linuxfoundation.org">richard.purdie@linuxfoundation.org</a>&gt;<br>
&gt;&gt; Signed-off-by: Armin Kuster &lt;<a href="mailto:akuster808@gmail.com">akuster808@gmail.com</a>&gt;<br>
&gt;&gt; ---<br>
&gt;&gt;  .../recipes-core/glibc/glibc/CVE-2015-9761_1.patch | 1039 ++++++++++++++++++++<br>
&gt;&gt;  .../recipes-core/glibc/glibc/CVE-2015-9761_2.patch |  388 ++++++++<br>
&gt;&gt;  meta/recipes-core/glibc/<a href="http://glibc_2.20.bb" rel="noreferrer" target="_blank">glibc_2.20.bb</a>              |    2 +<br>
&gt;&gt;  3 files changed, 1429 insertions(+)<br>
&gt;&gt;  create mode 100644 meta/recipes-core/glibc/glibc/CVE-2015-9761_1.patch<br>
&gt;&gt;  create mode 100644 meta/recipes-core/glibc/glibc/CVE-2015-9761_2.patch<br>
&gt;&gt;<br>
&gt;&gt; diff --git a/meta/recipes-core/glibc/glibc/CVE-2015-9761_1.patch b/meta/recipes-core/glibc/glibc/CVE-2015-9761_1.patch<br>
&gt;&gt; new file mode 100644<br>
&gt;&gt; index 0000000..3aca913<br>
&gt;&gt; --- /dev/null<br>
&gt;&gt; +++ b/meta/recipes-core/glibc/glibc/CVE-2015-9761_1.patch<br>
&gt;&gt; @@ -0,0 +1,1039 @@<br>
&gt;&gt; +From e02cabecf0d025ec4f4ddee290bdf7aadb873bb3 Mon Sep 17 00:00:00 2001<br>
&gt;&gt; +From: Joseph Myers &lt;<a href="mailto:joseph@codesourcery.com">joseph@codesourcery.com</a>&gt;<br>
&gt;&gt; +Date: Tue, 24 Nov 2015 22:24:52 +0000<br>
&gt;&gt; +Subject: [PATCH] Refactor strtod parsing of NaN payloads.<br>
&gt;&gt; +<br>
&gt;&gt; +The nan* functions handle their string argument by constructing a<br>
&gt;&gt; +NAN(...) string on the stack as a VLA and passing it to strtod<br>
&gt;&gt; +functions.<br>
&gt;&gt; +<br>
&gt;&gt; +This approach has problems discussed in bug 16961 and bug 16962: the<br>
&gt;&gt; +stack usage is unbounded, and it gives incorrect results in certain<br>
&gt;&gt; +cases where the argument is not a valid n-char-sequence.<br>
&gt;&gt; +<br>
&gt;&gt; +The natural fix for both issues is to refactor the NaN payload parsing<br>
&gt;&gt; +out of strtod into a separate function that the nan* functions can<br>
&gt;&gt; +call directly, so that no temporary string needs constructing on the<br>
&gt;&gt; +stack at all.  This patch does that refactoring in preparation for<br>
&gt;&gt; +fixing those bugs (but without actually using the new functions from<br>
&gt;&gt; +nan* - which will also require exporting them from libc at version<br>
&gt;&gt; +GLIBC_PRIVATE).  This patch is not intended to change any user-visible<br>
&gt;&gt; +behavior, so no tests are added (fixes for the above bugs will of<br>
&gt;&gt; +course add tests for them).<br>
&gt;&gt; +<br>
&gt;&gt; +This patch builds on my recent fixes for strtol and strtod issues in<br>
&gt;&gt; +Turkish locales.  Given those fixes, the parsing of NaN payloads is<br>
&gt;&gt; +locale-independent; thus, the new functions do not need to take a<br>
&gt;&gt; +locale_t argument.<br>
&gt;&gt; +<br>
&gt;&gt; +Tested for x86_64, x86, mips64 and powerpc.<br>
&gt;&gt; +<br>
&gt;&gt; +    * stdlib/strtod_nan.c: New file.<br>
&gt;&gt; +    * stdlib/strtod_nan_double.h: Likewise.<br>
&gt;&gt; +    * stdlib/strtod_nan_float.h: Likewise.<br>
&gt;&gt; +    * stdlib/strtod_nan_main.c: Likewise.<br>
&gt;&gt; +    * stdlib/strtod_nan_narrow.h: Likewise.<br>
&gt;&gt; +    * stdlib/strtod_nan_wide.h: Likewise.<br>
&gt;&gt; +    * stdlib/strtof_nan.c: Likewise.<br>
&gt;&gt; +    * stdlib/strtold_nan.c: Likewise.<br>
&gt;&gt; +    * sysdeps/ieee754/ldbl-128/strtod_nan_ldouble.h: Likewise.<br>
&gt;&gt; +    * sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h: Likewise.<br>
&gt;&gt; +    * sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h: Likewise.<br>
&gt;&gt; +    * wcsmbs/wcstod_nan.c: Likewise.<br>
&gt;&gt; +    * wcsmbs/wcstof_nan.c: Likewise.<br>
&gt;&gt; +    * wcsmbs/wcstold_nan.c: Likewise.<br>
&gt;&gt; +    * stdlib/Makefile (routines): Add strtof_nan, strtod_nan and<br>
&gt;&gt; +    strtold_nan.<br>
&gt;&gt; +    * wcsmbs/Makefile (routines): Add wcstod_nan, wcstold_nan and<br>
&gt;&gt; +    wcstof_nan.<br>
&gt;&gt; +    * include/stdlib.h (__strtof_nan): Declare and use<br>
&gt;&gt; +    libc_hidden_proto.<br>
&gt;&gt; +    (__strtod_nan): Likewise.<br>
&gt;&gt; +    (__strtold_nan): Likewise.<br>
&gt;&gt; +    (__wcstof_nan): Likewise.<br>
&gt;&gt; +    (__wcstod_nan): Likewise.<br>
&gt;&gt; +    (__wcstold_nan): Likewise.<br>
&gt;&gt; +    * include/wchar.h (____wcstoull_l_internal): Declare.<br>
&gt;&gt; +    * stdlib/strtod_l.c: Do not include &lt;ieee754.h&gt;.<br>
&gt;&gt; +    (____strtoull_l_internal): Remove declaration.<br>
&gt;&gt; +    (STRTOF_NAN): Define macro.<br>
&gt;&gt; +    (SET_MANTISSA): Remove macro.<br>
&gt;&gt; +    (STRTOULL): Likewise.<br>
&gt;&gt; +    (____STRTOF_INTERNAL): Use STRTOF_NAN to parse NaN payload.<br>
&gt;&gt; +    * stdlib/strtof_l.c (____strtoull_l_internal): Remove declaration.<br>
&gt;&gt; +    (STRTOF_NAN): Define macro.<br>
&gt;&gt; +    (SET_MANTISSA): Remove macro.<br>
&gt;&gt; +    * sysdeps/ieee754/ldbl-128/strtold_l.c (STRTOF_NAN): Define macro.<br>
&gt;&gt; +    (SET_MANTISSA): Remove macro.<br>
&gt;&gt; +    * sysdeps/ieee754/ldbl-128ibm/strtold_l.c (STRTOF_NAN): Define<br>
&gt;&gt; +    macro.<br>
&gt;&gt; +    (SET_MANTISSA): Remove macro.<br>
&gt;&gt; +    * sysdeps/ieee754/ldbl-64-128/strtold_l.c (STRTOF_NAN): Define<br>
&gt;&gt; +    macro.<br>
&gt;&gt; +    (SET_MANTISSA): Remove macro.<br>
&gt;&gt; +    * sysdeps/ieee754/ldbl-96/strtold_l.c (STRTOF_NAN): Define macro.<br>
&gt;&gt; +    (SET_MANTISSA): Remove macro.<br>
&gt;&gt; +    * wcsmbs/wcstod_l.c (____wcstoull_l_internal): Remove declaration.<br>
&gt;&gt; +    * wcsmbs/wcstof_l.c (____wcstoull_l_internal): Likewise.<br>
&gt;&gt; +    * wcsmbs/wcstold_l.c (____wcstoull_l_internal): Likewise.<br>
&gt;&gt; +<br>
&gt;&gt; +Upstream-Status: Backport<br>
&gt;&gt; +CVE: CVE-2015-9761 patch #1<br>
&gt;&gt; +[Yocto # 8980]<br>
&gt;&gt; +<br>
&gt;&gt; +<a href="https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e02cabecf0d025ec4f4ddee290bdf7aadb873bb3" rel="noreferrer" target="_blank">https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e02cabecf0d025ec4f4ddee290bdf7aadb873bb3</a><br>
&gt;&gt; +<br>
&gt;&gt; +Signed-off-by: Armin Kuster &lt;<a href="mailto:akuster@mvista.com">akuster@mvista.com</a>&gt;<br>
&gt;&gt; +<br>
&gt;&gt; +---<br>
&gt;&gt; + ChangeLog                                        | 49 ++++++++++++++++++<br>
&gt;&gt; + include/stdlib.h                                 | 18 +++++++<br>
&gt;&gt; + include/wchar.h                                  |  3 ++<br>
&gt;&gt; + stdlib/Makefile                                  |  1 +<br>
&gt;&gt; + stdlib/strtod_l.c                                | 48 ++++--------------<br>
&gt;&gt; + stdlib/strtod_nan.c                              | 24 +++++++++<br>
&gt;&gt; + stdlib/strtod_nan_double.h                       | 30 +++++++++++<br>
&gt;&gt; + stdlib/strtod_nan_float.h                        | 29 +++++++++++<br>
&gt;&gt; + stdlib/strtod_nan_main.c                         | 63 ++++++++++++++++++++++++<br>
&gt;&gt; + stdlib/strtod_nan_narrow.h                       | 22 +++++++++<br>
&gt;&gt; + stdlib/strtod_nan_wide.h                         | 22 +++++++++<br>
&gt;&gt; + stdlib/strtof_l.c                                | 11 +----<br>
&gt;&gt; + stdlib/strtof_nan.c                              | 24 +++++++++<br>
&gt;&gt; + stdlib/strtold_nan.c                             | 30 +++++++++++<br>
&gt;&gt; + sysdeps/ieee754/ldbl-128/strtod_nan_ldouble.h    | 33 +++++++++++++<br>
&gt;&gt; + sysdeps/ieee754/ldbl-128/strtold_l.c             | 13 +----<br>
&gt;&gt; + sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h | 30 +++++++++++<br>
&gt;&gt; + sysdeps/ieee754/ldbl-128ibm/strtold_l.c          | 10 +---<br>
&gt;&gt; + sysdeps/ieee754/ldbl-64-128/strtold_l.c          | 13 +----<br>
&gt;&gt; + sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h     | 30 +++++++++++<br>
&gt;&gt; + sysdeps/ieee754/ldbl-96/strtold_l.c              | 10 +---<br>
&gt;&gt; + wcsmbs/Makefile                                  |  1 +<br>
&gt;&gt; + wcsmbs/wcstod_l.c                                |  3 --<br>
&gt;&gt; + wcsmbs/wcstod_nan.c                              | 23 +++++++++<br>
&gt;&gt; + wcsmbs/wcstof_l.c                                |  3 --<br>
&gt;&gt; + wcsmbs/wcstof_nan.c                              | 23 +++++++++<br>
&gt;&gt; + wcsmbs/wcstold_l.c                               |  3 --<br>
&gt;&gt; + wcsmbs/wcstold_nan.c                             | 30 +++++++++++<br>
&gt;&gt; + 28 files changed, 504 insertions(+), 95 deletions(-)<br>
&gt;&gt; + create mode 100644 stdlib/strtod_nan.c<br>
&gt;&gt; + create mode 100644 stdlib/strtod_nan_double.h<br>
&gt;&gt; + create mode 100644 stdlib/strtod_nan_float.h<br>
&gt;&gt; + create mode 100644 stdlib/strtod_nan_main.c<br>
&gt;&gt; + create mode 100644 stdlib/strtod_nan_narrow.h<br>
&gt;&gt; + create mode 100644 stdlib/strtod_nan_wide.h<br>
&gt;&gt; + create mode 100644 stdlib/strtof_nan.c<br>
&gt;&gt; + create mode 100644 stdlib/strtold_nan.c<br>
&gt;&gt; + create mode 100644 sysdeps/ieee754/ldbl-128/strtod_nan_ldouble.h<br>
&gt;&gt; + create mode 100644 sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h<br>
&gt;&gt; + create mode 100644 sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h<br>
&gt;&gt; + create mode 100644 wcsmbs/wcstod_nan.c<br>
&gt;&gt; + create mode 100644 wcsmbs/wcstof_nan.c<br>
&gt;&gt; + create mode 100644 wcsmbs/wcstold_nan.c<br>
&gt;&gt; +<br>
&gt;&gt; +Index: git/include/stdlib.h<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/include/stdlib.h<br>
&gt;&gt; ++++ git/include/stdlib.h<br>
&gt;&gt; +@@ -203,6 +203,24 @@ libc_hidden_proto (strtoll)<br>
&gt;&gt; + libc_hidden_proto (strtoul)<br>
&gt;&gt; + libc_hidden_proto (strtoull)<br>
&gt;&gt; +<br>
&gt;&gt; ++extern float __strtof_nan (const char *, char **, char) internal_function;<br>
&gt;&gt; ++extern double __strtod_nan (const char *, char **, char) internal_function;<br>
&gt;&gt; ++extern long double __strtold_nan (const char *, char **, char)<br>
&gt;&gt; ++     internal_function;<br>
&gt;&gt; ++extern float __wcstof_nan (const wchar_t *, wchar_t **, wchar_t)<br>
&gt;&gt; ++     internal_function;<br>
&gt;&gt; ++extern double __wcstod_nan (const wchar_t *, wchar_t **, wchar_t)<br>
&gt;&gt; ++     internal_function;<br>
&gt;&gt; ++extern long double __wcstold_nan (const wchar_t *, wchar_t **, wchar_t)<br>
&gt;&gt; ++     internal_function;<br>
&gt;&gt; ++<br>
&gt;&gt; ++libc_hidden_proto (__strtof_nan)<br>
&gt;&gt; ++libc_hidden_proto (__strtod_nan)<br>
&gt;&gt; ++libc_hidden_proto (__strtold_nan)<br>
&gt;&gt; ++libc_hidden_proto (__wcstof_nan)<br>
&gt;&gt; ++libc_hidden_proto (__wcstod_nan)<br>
&gt;&gt; ++libc_hidden_proto (__wcstold_nan)<br>
&gt;&gt; ++<br>
&gt;&gt; + extern char *__ecvt (double __value, int __ndigit, int *__restrict __decpt,<br>
&gt;&gt; +                 int *__restrict __sign);<br>
&gt;&gt; + extern char *__fcvt (double __value, int __ndigit, int *__restrict __decpt,<br>
&gt;&gt; +Index: git/include/wchar.h<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/include/wchar.h<br>
&gt;&gt; ++++ git/include/wchar.h<br>
&gt;&gt; +@@ -52,6 +52,9 @@ extern unsigned long long int __wcstoull<br>
&gt;&gt; +                                               __restrict __endptr,<br>
&gt;&gt; +                                               int __base,<br>
&gt;&gt; +                                               int __group) __THROW;<br>
&gt;&gt; ++extern unsigned long long int ____wcstoull_l_internal (const wchar_t *,<br>
&gt;&gt; ++                                                  wchar_t **, int, int,<br>
&gt;&gt; ++                                                  __locale_t);<br>
&gt;&gt; + libc_hidden_proto (__wcstof_internal)<br>
&gt;&gt; + libc_hidden_proto (__wcstod_internal)<br>
&gt;&gt; + libc_hidden_proto (__wcstold_internal)<br>
&gt;&gt; +Index: git/stdlib/Makefile<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/stdlib/Makefile<br>
&gt;&gt; ++++ git/stdlib/Makefile<br>
&gt;&gt; +@@ -51,6 +51,7 @@ routines-y        :=                                                            \<br>
&gt;&gt; +    strtol_l strtoul_l strtoll_l strtoull_l                               \<br>
&gt;&gt; +    strtof strtod strtold                                                 \<br>
&gt;&gt; +    strtof_l strtod_l strtold_l                                           \<br>
&gt;&gt; ++   strtof_nan strtod_nan strtold_nan                                     \<br>
&gt;&gt; +    system canonicalize                                                   \<br>
&gt;&gt; +    a64l l64a                                                             \<br>
&gt;&gt; +    getsubopt xpg_basename                                                \<br>
&gt;&gt; +Index: git/stdlib/strtod_l.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/stdlib/strtod_l.c<br>
&gt;&gt; ++++ git/stdlib/strtod_l.c<br>
&gt;&gt; +@@ -21,8 +21,6 @@<br>
&gt;&gt; + #include &lt;xlocale.h&gt;<br>
&gt;&gt; +<br>
&gt;&gt; + extern double ____strtod_l_internal (const char *, char **, int, __locale_t);<br>
&gt;&gt; +-extern unsigned long long int ____strtoull_l_internal (const char *, char **,<br>
&gt;&gt; +-                                                  int, int, __locale_t);<br>
&gt;&gt; +<br>
&gt;&gt; + /* Configuration part.  These macros are defined by `strtold.c&#39;,<br>
&gt;&gt; +    `strtof.c&#39;, `wcstod.c&#39;, `wcstold.c&#39;, and `wcstof.c&#39; to produce the<br>
&gt;&gt; +@@ -34,27 +32,20 @@ extern unsigned long long int ____strtou<br>
&gt;&gt; + # ifdef USE_WIDE_CHAR<br>
&gt;&gt; + #  define STRTOF   wcstod_l<br>
&gt;&gt; + #  define __STRTOF __wcstod_l<br>
&gt;&gt; ++#  define STRTOF_NAN       __wcstod_nan<br>
&gt;&gt; + # else<br>
&gt;&gt; + #  define STRTOF   strtod_l<br>
&gt;&gt; + #  define __STRTOF __strtod_l<br>
&gt;&gt; ++#  define STRTOF_NAN       __strtod_nan<br>
&gt;&gt; + # endif<br>
&gt;&gt; + # define MPN2FLOAT __mpn_construct_double<br>
&gt;&gt; + # define FLOAT_HUGE_VAL    HUGE_VAL<br>
&gt;&gt; +-# define SET_MANTISSA(flt, mant) \<br>
&gt;&gt; +-  do { union ieee754_double u;                                                   \<br>
&gt;&gt; +-       u.d = (flt);                                                              \<br>
&gt;&gt; +-       u.ieee_nan.mantissa0 = (mant) &gt;&gt; 32;                                      \<br>
&gt;&gt; +-       u.ieee_nan.mantissa1 = (mant);                                            \<br>
&gt;&gt; +-       if ((u.ieee.mantissa0 | u.ieee.mantissa1) != 0)                           \<br>
&gt;&gt; +-    (flt) = u.d;                                                         \<br>
&gt;&gt; +-  } while (0)<br>
&gt;&gt; + #endif<br>
&gt;&gt; + /* End of configuration part.  */<br>
&gt;&gt; +<br>
&gt;&gt; + #include &lt;ctype.h&gt;<br>
&gt;&gt; + #include &lt;errno.h&gt;<br>
&gt;&gt; + #include &lt;float.h&gt;<br>
&gt;&gt; +-#include &lt;ieee754.h&gt;<br>
&gt;&gt; + #include &quot;../locale/localeinfo.h&quot;<br>
&gt;&gt; + #include &lt;locale.h&gt;<br>
&gt;&gt; + #include &lt;math.h&gt;<br>
&gt;&gt; +@@ -105,7 +96,6 @@ extern unsigned long long int ____strtou<br>
&gt;&gt; + # define TOLOWER_C(Ch) __towlower_l ((Ch), _nl_C_locobj_ptr)<br>
&gt;&gt; + # define STRNCASECMP(S1, S2, N) \<br>
&gt;&gt; +   __wcsncasecmp_l ((S1), (S2), (N), _nl_C_locobj_ptr)<br>
&gt;&gt; +-# define STRTOULL(S, E, B) ____wcstoull_l_internal ((S), (E), (B), 0, loc)<br>
&gt;&gt; + #else<br>
&gt;&gt; + # define STRING_TYPE char<br>
&gt;&gt; + # define CHAR_TYPE char<br>
&gt;&gt; +@@ -117,7 +107,6 @@ extern unsigned long long int ____strtou<br>
&gt;&gt; + # define TOLOWER_C(Ch) __tolower_l ((Ch), _nl_C_locobj_ptr)<br>
&gt;&gt; + # define STRNCASECMP(S1, S2, N) \<br>
&gt;&gt; +   __strncasecmp_l ((S1), (S2), (N), _nl_C_locobj_ptr)<br>
&gt;&gt; +-# define STRTOULL(S, E, B) ____strtoull_l_internal ((S), (E), (B), 0, loc)<br>
&gt;&gt; + #endif<br>
&gt;&gt; +<br>
&gt;&gt; +<br>
&gt;&gt; +@@ -668,33 +657,14 @@ ____STRTOF_INTERNAL (nptr, endptr, group<br>
&gt;&gt; +      if (*cp == L_(&#39;(&#39;))<br>
&gt;&gt; +        {<br>
&gt;&gt; +          const STRING_TYPE *startp = cp;<br>
&gt;&gt; +-         do<br>
&gt;&gt; +-           ++cp;<br>
&gt;&gt; +-         while ((*cp &gt;= L_(&#39;0&#39;) &amp;&amp; *cp &lt;= L_(&#39;9&#39;))<br>
&gt;&gt; +-                || ({ CHAR_TYPE lo = TOLOWER (*cp);<br>
&gt;&gt; +-                      lo &gt;= L_(&#39;a&#39;) &amp;&amp; lo &lt;= L_(&#39;z&#39;); })<br>
&gt;&gt; +-                || *cp == L_(&#39;_&#39;));<br>
&gt;&gt; +-<br>
&gt;&gt; +-         if (*cp != L_(&#39;)&#39;))<br>
&gt;&gt; +-           /* The closing brace is missing.  Only match the NAN<br>
&gt;&gt; +-              part.  */<br>
&gt;&gt; +-           cp = startp;<br>
&gt;&gt; ++          STRING_TYPE *endp;<br>
&gt;&gt; ++          retval = STRTOF_NAN (cp + 1, &amp;endp, L_(&#39;)&#39;));<br>
&gt;&gt; ++          if (*endp == L_(&#39;)&#39;))<br>
&gt;&gt; ++            /* Consume the closing parenthesis.  */<br>
&gt;&gt; ++            cp = endp + 1;<br>
&gt;&gt; +          else<br>
&gt;&gt; +-           {<br>
&gt;&gt; +-             /* This is a system-dependent way to specify the<br>
&gt;&gt; +-                bitmask used for the NaN.  We expect it to be<br>
&gt;&gt; +-                a number which is put in the mantissa of the<br>
&gt;&gt; +-                number.  */<br>
&gt;&gt; +-             STRING_TYPE *endp;<br>
&gt;&gt; +-             unsigned long long int mant;<br>
&gt;&gt; +-<br>
&gt;&gt; +-             mant = STRTOULL (startp + 1, &amp;endp, 0);<br>
&gt;&gt; +-             if (endp == cp)<br>
&gt;&gt; +-               SET_MANTISSA (retval, mant);<br>
&gt;&gt; +-<br>
&gt;&gt; +-             /* Consume the closing brace.  */<br>
&gt;&gt; +-             ++cp;<br>
&gt;&gt; +-           }<br>
&gt;&gt; ++               /* Only match the NAN part.  */<br>
&gt;&gt; ++               cp = startp;<br>
&gt;&gt; +        }<br>
&gt;&gt; +<br>
&gt;&gt; +      if (endptr != NULL)<br>
&gt;&gt; +Index: git/stdlib/strtod_nan.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- /dev/null<br>
&gt;&gt; ++++ git/stdlib/strtod_nan.c<br>
&gt;&gt; +@@ -0,0 +1,24 @@<br>
&gt;&gt; ++/* Convert string for NaN payload to corresponding NaN.  Narrow<br>
&gt;&gt; ++   strings, double.<br>
&gt;&gt; ++   Copyright (C) 2015 Free Software Foundation, Inc.<br>
&gt;&gt; ++   This file is part of the GNU C Library.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is free software; you can redistribute it and/or<br>
&gt;&gt; ++   modify it under the terms of the GNU Lesser General Public<br>
&gt;&gt; ++   License as published by the Free Software Foundation; either<br>
&gt;&gt; ++   version 2.1 of the License, or (at your option) any later version.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is distributed in the hope that it will be useful,<br>
&gt;&gt; ++   but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
&gt;&gt; ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
&gt;&gt; ++   Lesser General Public License for more details.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   You should have received a copy of the GNU Lesser General Public<br>
&gt;&gt; ++   License along with the GNU C Library; if not, see<br>
&gt;&gt; ++   &lt;<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>&gt;.  */<br>
&gt;&gt; ++<br>
&gt;&gt; ++#include &lt;strtod_nan_narrow.h&gt;<br>
&gt;&gt; ++#include &lt;strtod_nan_double.h&gt;<br>
&gt;&gt; ++<br>
&gt;&gt; ++#define STRTOD_NAN __strtod_nan<br>
&gt;&gt; ++#include &lt;strtod_nan_main.c&gt;<br>
&gt;&gt; +Index: git/stdlib/strtod_nan_double.h<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- /dev/null<br>
&gt;&gt; ++++ git/stdlib/strtod_nan_double.h<br>
&gt;&gt; +@@ -0,0 +1,30 @@<br>
&gt;&gt; ++/* Convert string for NaN payload to corresponding NaN.  For double.<br>
&gt;&gt; ++   Copyright (C) 1997-2015 Free Software Foundation, Inc.<br>
&gt;&gt; ++   This file is part of the GNU C Library.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is free software; you can redistribute it and/or<br>
&gt;&gt; ++   modify it under the terms of the GNU Lesser General Public<br>
&gt;&gt; ++   License as published by the Free Software Foundation; either<br>
&gt;&gt; ++   version 2.1 of the License, or (at your option) any later version.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is distributed in the hope that it will be useful,<br>
&gt;&gt; ++   but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
&gt;&gt; ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
&gt;&gt; ++   Lesser General Public License for more details.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   You should have received a copy of the GNU Lesser General Public<br>
&gt;&gt; ++   License along with the GNU C Library; if not, see<br>
&gt;&gt; ++   &lt;<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>&gt;.  */<br>
&gt;&gt; ++<br>
&gt;&gt; ++#define FLOAT              double<br>
&gt;&gt; ++#define SET_MANTISSA(flt, mant)                            \<br>
&gt;&gt; ++  do                                                       \<br>
&gt;&gt; ++    {                                                      \<br>
&gt;&gt; ++      union ieee754_double u;                              \<br>
&gt;&gt; ++      u.d = (flt);                                 \<br>
&gt;&gt; ++      u.ieee_nan.mantissa0 = (mant) &gt;&gt; 32;         \<br>
&gt;&gt; ++      u.ieee_nan.mantissa1 = (mant);                       \<br>
&gt;&gt; ++      if ((u.ieee.mantissa0 | u.ieee.mantissa1) != 0)      \<br>
&gt;&gt; ++   (flt) = u.d;                                    \<br>
&gt;&gt; ++    }                                                      \<br>
&gt;&gt; ++  while (0)<br>
&gt;&gt; +Index: git/stdlib/strtod_nan_float.h<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- /dev/null<br>
&gt;&gt; ++++ git/stdlib/strtod_nan_float.h<br>
&gt;&gt; +@@ -0,0 +1,29 @@<br>
&gt;&gt; ++/* Convert string for NaN payload to corresponding NaN.  For float.<br>
&gt;&gt; ++   Copyright (C) 1997-2015 Free Software Foundation, Inc.<br>
&gt;&gt; ++   This file is part of the GNU C Library.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is free software; you can redistribute it and/or<br>
&gt;&gt; ++   modify it under the terms of the GNU Lesser General Public<br>
&gt;&gt; ++   License as published by the Free Software Foundation; either<br>
&gt;&gt; ++   version 2.1 of the License, or (at your option) any later version.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is distributed in the hope that it will be useful,<br>
&gt;&gt; ++   but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
&gt;&gt; ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
&gt;&gt; ++   Lesser General Public License for more details.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   You should have received a copy of the GNU Lesser General Public<br>
&gt;&gt; ++   License along with the GNU C Library; if not, see<br>
&gt;&gt; ++   &lt;<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>&gt;.  */<br>
&gt;&gt; ++<br>
&gt;&gt; ++#define    FLOAT           float<br>
&gt;&gt; ++#define SET_MANTISSA(flt, mant)                    \<br>
&gt;&gt; ++  do                                               \<br>
&gt;&gt; ++    {                                              \<br>
&gt;&gt; ++      union ieee754_float u;                       \<br>
&gt;&gt; ++      u.f = (flt);                         \<br>
&gt;&gt; ++      u.ieee_nan.mantissa = (mant);                \<br>
&gt;&gt; ++      if (u.ieee.mantissa != 0)                    \<br>
&gt;&gt; ++   (flt) = u.f;                            \<br>
&gt;&gt; ++    }                                              \<br>
&gt;&gt; ++  while (0)<br>
&gt;&gt; +Index: git/stdlib/strtod_nan_main.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- /dev/null<br>
&gt;&gt; ++++ git/stdlib/strtod_nan_main.c<br>
&gt;&gt; +@@ -0,0 +1,63 @@<br>
&gt;&gt; ++/* Convert string for NaN payload to corresponding NaN.<br>
&gt;&gt; ++   Copyright (C) 1997-2015 Free Software Foundation, Inc.<br>
&gt;&gt; ++   This file is part of the GNU C Library.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is free software; you can redistribute it and/or<br>
&gt;&gt; ++   modify it under the terms of the GNU Lesser General Public<br>
&gt;&gt; ++   License as published by the Free Software Foundation; either<br>
&gt;&gt; ++   version 2.1 of the License, or (at your option) any later version.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is distributed in the hope that it will be useful,<br>
&gt;&gt; ++   but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
&gt;&gt; ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
&gt;&gt; ++   Lesser General Public License for more details.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   You should have received a copy of the GNU Lesser General Public<br>
&gt;&gt; ++   License along with the GNU C Library; if not, see<br>
&gt;&gt; ++   &lt;<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>&gt;.  */<br>
&gt;&gt; ++<br>
&gt;&gt; ++#include &lt;ieee754.h&gt;<br>
&gt;&gt; ++#include &lt;locale.h&gt;<br>
&gt;&gt; ++#include &lt;math.h&gt;<br>
&gt;&gt; ++#include &lt;stdlib.h&gt;<br>
&gt;&gt; ++#include &lt;wchar.h&gt;<br>
&gt;&gt; ++<br>
&gt;&gt; ++<br>
&gt;&gt; ++/* If STR starts with an optional n-char-sequence as defined by ISO C<br>
&gt;&gt; ++   (a sequence of ASCII letters, digits and underscores), followed by<br>
&gt;&gt; ++   ENDC, return a NaN whose payload is set based on STR.  Otherwise,<br>
&gt;&gt; ++   return a default NAN.  If ENDPTR is not NULL, set *ENDPTR to point<br>
&gt;&gt; ++   to the character after the initial n-char-sequence.  */<br>
&gt;&gt; ++<br>
&gt;&gt; ++internal_function<br>
&gt;&gt; ++FLOAT<br>
&gt;&gt; ++STRTOD_NAN (const STRING_TYPE *str, STRING_TYPE **endptr, STRING_TYPE endc)<br>
&gt;&gt; ++{<br>
&gt;&gt; ++  const STRING_TYPE *cp = str;<br>
&gt;&gt; ++<br>
&gt;&gt; ++  while ((*cp &gt;= L_(&#39;0&#39;) &amp;&amp; *cp &lt;= L_(&#39;9&#39;))<br>
&gt;&gt; ++    || (*cp &gt;= L_(&#39;A&#39;) &amp;&amp; *cp &lt;= L_(&#39;Z&#39;))<br>
&gt;&gt; ++    || (*cp &gt;= L_(&#39;a&#39;) &amp;&amp; *cp &lt;= L_(&#39;z&#39;))<br>
&gt;&gt; ++    || *cp == L_(&#39;_&#39;))<br>
&gt;&gt; ++    ++cp;<br>
&gt;&gt; ++<br>
&gt;&gt; ++  FLOAT retval = NAN;<br>
&gt;&gt; ++  if (*cp != endc)<br>
&gt;&gt; ++    goto out;<br>
&gt;&gt; ++<br>
&gt;&gt; ++  /* This is a system-dependent way to specify the bitmask used for<br>
&gt;&gt; ++     the NaN.  We expect it to be a number which is put in the<br>
&gt;&gt; ++     mantissa of the number.  */<br>
&gt;&gt; ++  STRING_TYPE *endp;<br>
&gt;&gt; ++  unsigned long long int mant;<br>
&gt;&gt; ++<br>
&gt;&gt; ++  mant = STRTOULL (str, &amp;endp, 0);<br>
&gt;&gt; ++  if (endp == cp)<br>
&gt;&gt; ++    SET_MANTISSA (retval, mant);<br>
&gt;&gt; ++<br>
&gt;&gt; ++ out:<br>
&gt;&gt; ++  if (endptr != NULL)<br>
&gt;&gt; ++    *endptr = (STRING_TYPE *) cp;<br>
&gt;&gt; ++  return retval;<br>
&gt;&gt; ++}<br>
&gt;&gt; ++libc_hidden_def (STRTOD_NAN)<br>
&gt;&gt; +Index: git/stdlib/strtod_nan_narrow.h<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- /dev/null<br>
&gt;&gt; ++++ git/stdlib/strtod_nan_narrow.h<br>
&gt;&gt; +@@ -0,0 +1,22 @@<br>
&gt;&gt; ++/* Convert string for NaN payload to corresponding NaN.  Narrow strings.<br>
&gt;&gt; ++   Copyright (C) 1997-2015 Free Software Foundation, Inc.<br>
&gt;&gt; ++   This file is part of the GNU C Library.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is free software; you can redistribute it and/or<br>
&gt;&gt; ++   modify it under the terms of the GNU Lesser General Public<br>
&gt;&gt; ++   License as published by the Free Software Foundation; either<br>
&gt;&gt; ++   version 2.1 of the License, or (at your option) any later version.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is distributed in the hope that it will be useful,<br>
&gt;&gt; ++   but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
&gt;&gt; ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
&gt;&gt; ++   Lesser General Public License for more details.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   You should have received a copy of the GNU Lesser General Public<br>
&gt;&gt; ++   License along with the GNU C Library; if not, see<br>
&gt;&gt; ++   &lt;<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>&gt;.  */<br>
&gt;&gt; ++<br>
&gt;&gt; ++#define STRING_TYPE char<br>
&gt;&gt; ++#define L_(Ch) Ch<br>
&gt;&gt; ++#define STRTOULL(S, E, B) ____strtoull_l_internal ((S), (E), (B), 0,       \<br>
&gt;&gt; ++                                              _nl_C_locobj_ptr)<br>
&gt;&gt; +Index: git/stdlib/strtod_nan_wide.h<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- /dev/null<br>
&gt;&gt; ++++ git/stdlib/strtod_nan_wide.h<br>
&gt;&gt; +@@ -0,0 +1,22 @@<br>
&gt;&gt; ++/* Convert string for NaN payload to corresponding NaN.  Wide strings.<br>
&gt;&gt; ++   Copyright (C) 1997-2015 Free Software Foundation, Inc.<br>
&gt;&gt; ++   This file is part of the GNU C Library.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is free software; you can redistribute it and/or<br>
&gt;&gt; ++   modify it under the terms of the GNU Lesser General Public<br>
&gt;&gt; ++   License as published by the Free Software Foundation; either<br>
&gt;&gt; ++   version 2.1 of the License, or (at your option) any later version.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is distributed in the hope that it will be useful,<br>
&gt;&gt; ++   but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
&gt;&gt; ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
&gt;&gt; ++   Lesser General Public License for more details.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   You should have received a copy of the GNU Lesser General Public<br>
&gt;&gt; ++   License along with the GNU C Library; if not, see<br>
&gt;&gt; ++   &lt;<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>&gt;.  */<br>
&gt;&gt; ++<br>
&gt;&gt; ++#define STRING_TYPE wchar_t<br>
&gt;&gt; ++#define L_(Ch) L##Ch<br>
&gt;&gt; ++#define STRTOULL(S, E, B) ____wcstoull_l_internal ((S), (E), (B), 0,       \<br>
&gt;&gt; ++                                              _nl_C_locobj_ptr)<br>
&gt;&gt; +Index: git/stdlib/strtof_l.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/stdlib/strtof_l.c<br>
&gt;&gt; ++++ git/stdlib/strtof_l.c<br>
&gt;&gt; +@@ -20,26 +20,19 @@<br>
&gt;&gt; + #include &lt;xlocale.h&gt;<br>
&gt;&gt; +<br>
&gt;&gt; + extern float ____strtof_l_internal (const char *, char **, int, __locale_t);<br>
&gt;&gt; +-extern unsigned long long int ____strtoull_l_internal (const char *, char **,<br>
&gt;&gt; +-                                                  int, int, __locale_t);<br>
&gt;&gt; +<br>
&gt;&gt; + #define    FLOAT           float<br>
&gt;&gt; + #define    FLT             FLT<br>
&gt;&gt; + #ifdef USE_WIDE_CHAR<br>
&gt;&gt; + # define STRTOF            wcstof_l<br>
&gt;&gt; + # define __STRTOF  __wcstof_l<br>
&gt;&gt; ++# define STRTOF_NAN        __wcstof_nan<br>
&gt;&gt; + #else<br>
&gt;&gt; + # define STRTOF            strtof_l<br>
&gt;&gt; + # define __STRTOF  __strtof_l<br>
&gt;&gt; ++# define STRTOF_NAN        __strtof_nan<br>
&gt;&gt; + #endif<br>
&gt;&gt; + #define    MPN2FLOAT       __mpn_construct_float<br>
&gt;&gt; + #define    FLOAT_HUGE_VAL  HUGE_VALF<br>
&gt;&gt; +-#define SET_MANTISSA(flt, mant) \<br>
&gt;&gt; +-  do { union ieee754_float u;                                                    \<br>
&gt;&gt; +-       u.f = (flt);                                                              \<br>
&gt;&gt; +-       u.ieee_nan.mantissa = (mant);                                             \<br>
&gt;&gt; +-       if (u.ieee.mantissa != 0)                                         \<br>
&gt;&gt; +-    (flt) = u.f;                                                         \<br>
&gt;&gt; +-  } while (0)<br>
&gt;&gt; +<br>
&gt;&gt; + #include &quot;strtod_l.c&quot;<br>
&gt;&gt; +Index: git/stdlib/strtof_nan.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- /dev/null<br>
&gt;&gt; ++++ git/stdlib/strtof_nan.c<br>
&gt;&gt; +@@ -0,0 +1,24 @@<br>
&gt;&gt; ++/* Convert string for NaN payload to corresponding NaN.  Narrow<br>
&gt;&gt; ++   strings, float.<br>
&gt;&gt; ++   Copyright (C) 2015 Free Software Foundation, Inc.<br>
&gt;&gt; ++   This file is part of the GNU C Library.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is free software; you can redistribute it and/or<br>
&gt;&gt; ++   modify it under the terms of the GNU Lesser General Public<br>
&gt;&gt; ++   License as published by the Free Software Foundation; either<br>
&gt;&gt; ++   version 2.1 of the License, or (at your option) any later version.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is distributed in the hope that it will be useful,<br>
&gt;&gt; ++   but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
&gt;&gt; ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
&gt;&gt; ++   Lesser General Public License for more details.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   You should have received a copy of the GNU Lesser General Public<br>
&gt;&gt; ++   License along with the GNU C Library; if not, see<br>
&gt;&gt; ++   &lt;<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>&gt;.  */<br>
&gt;&gt; ++<br>
&gt;&gt; ++#include &lt;strtod_nan_narrow.h&gt;<br>
&gt;&gt; ++#include &lt;strtod_nan_float.h&gt;<br>
&gt;&gt; ++<br>
&gt;&gt; ++#define STRTOD_NAN __strtof_nan<br>
&gt;&gt; ++#include &lt;strtod_nan_main.c&gt;<br>
&gt;&gt; +Index: git/stdlib/strtold_nan.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- /dev/null<br>
&gt;&gt; ++++ git/stdlib/strtold_nan.c<br>
&gt;&gt; +@@ -0,0 +1,30 @@<br>
&gt;&gt; ++/* Convert string for NaN payload to corresponding NaN.  Narrow<br>
&gt;&gt; ++   strings, long double.<br>
&gt;&gt; ++   Copyright (C) 2015 Free Software Foundation, Inc.<br>
&gt;&gt; ++   This file is part of the GNU C Library.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is free software; you can redistribute it and/or<br>
&gt;&gt; ++   modify it under the terms of the GNU Lesser General Public<br>
&gt;&gt; ++   License as published by the Free Software Foundation; either<br>
&gt;&gt; ++   version 2.1 of the License, or (at your option) any later version.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is distributed in the hope that it will be useful,<br>
&gt;&gt; ++   but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
&gt;&gt; ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
&gt;&gt; ++   Lesser General Public License for more details.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   You should have received a copy of the GNU Lesser General Public<br>
&gt;&gt; ++   License along with the GNU C Library; if not, see<br>
&gt;&gt; ++   &lt;<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>&gt;.  */<br>
&gt;&gt; ++<br>
&gt;&gt; ++#include &lt;math.h&gt;<br>
&gt;&gt; ++<br>
&gt;&gt; ++/* This function is unused if long double and double have the same<br>
&gt;&gt; ++   representation.  */<br>
&gt;&gt; ++#ifndef __NO_LONG_DOUBLE_MATH<br>
&gt;&gt; ++# include &lt;strtod_nan_narrow.h&gt;<br>
&gt;&gt; ++# include &lt;strtod_nan_ldouble.h&gt;<br>
&gt;&gt; ++<br>
&gt;&gt; ++# define STRTOD_NAN __strtold_nan<br>
&gt;&gt; ++# include &lt;strtod_nan_main.c&gt;<br>
&gt;&gt; ++#endif<br>
&gt;&gt; +Index: git/sysdeps/ieee754/ldbl-128/strtod_nan_ldouble.h<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- /dev/null<br>
&gt;&gt; ++++ git/sysdeps/ieee754/ldbl-128/strtod_nan_ldouble.h<br>
&gt;&gt; +@@ -0,0 +1,33 @@<br>
&gt;&gt; ++/* Convert string for NaN payload to corresponding NaN.  For ldbl-128.<br>
&gt;&gt; ++   Copyright (C) 1997-2015 Free Software Foundation, Inc.<br>
&gt;&gt; ++   This file is part of the GNU C Library.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is free software; you can redistribute it and/or<br>
&gt;&gt; ++   modify it under the terms of the GNU Lesser General Public<br>
&gt;&gt; ++   License as published by the Free Software Foundation; either<br>
&gt;&gt; ++   version 2.1 of the License, or (at your option) any later version.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is distributed in the hope that it will be useful,<br>
&gt;&gt; ++   but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
&gt;&gt; ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
&gt;&gt; ++   Lesser General Public License for more details.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   You should have received a copy of the GNU Lesser General Public<br>
&gt;&gt; ++   License along with the GNU C Library; if not, see<br>
&gt;&gt; ++   &lt;<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>&gt;.  */<br>
&gt;&gt; ++<br>
&gt;&gt; ++#define FLOAT              long double<br>
&gt;&gt; ++#define SET_MANTISSA(flt, mant)                            \<br>
&gt;&gt; ++  do                                                       \<br>
&gt;&gt; ++    {                                                      \<br>
&gt;&gt; ++      union ieee854_long_double u;                 \<br>
&gt;&gt; ++      u.d = (flt);                                 \<br>
&gt;&gt; ++      u.ieee_nan.mantissa0 = 0;                            \<br>
&gt;&gt; ++      u.ieee_nan.mantissa1 = 0;                            \<br>
&gt;&gt; ++      u.ieee_nan.mantissa2 = (mant) &gt;&gt; 32;         \<br>
&gt;&gt; ++      u.ieee_nan.mantissa3 = (mant);                       \<br>
&gt;&gt; ++      if ((u.ieee.mantissa0 | u.ieee.mantissa1             \<br>
&gt;&gt; ++      | u.ieee.mantissa2 | u.ieee.mantissa3) != 0) \<br>
&gt;&gt; ++   (flt) = u.d;                                    \<br>
&gt;&gt; ++    }                                                      \<br>
&gt;&gt; ++  while (0)<br>
&gt;&gt; +Index: git/sysdeps/ieee754/ldbl-128/strtold_l.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/sysdeps/ieee754/ldbl-128/strtold_l.c<br>
&gt;&gt; ++++ git/sysdeps/ieee754/ldbl-128/strtold_l.c<br>
&gt;&gt; +@@ -25,22 +25,13 @@<br>
&gt;&gt; + #ifdef USE_WIDE_CHAR<br>
&gt;&gt; + # define STRTOF            wcstold_l<br>
&gt;&gt; + # define __STRTOF  __wcstold_l<br>
&gt;&gt; ++# define STRTOF_NAN        __wcstold_nan<br>
&gt;&gt; + #else<br>
&gt;&gt; + # define STRTOF            strtold_l<br>
&gt;&gt; + # define __STRTOF  __strtold_l<br>
&gt;&gt; ++# define STRTOF_NAN        __strtold_nan<br>
&gt;&gt; + #endif<br>
&gt;&gt; + #define MPN2FLOAT  __mpn_construct_long_double<br>
&gt;&gt; + #define FLOAT_HUGE_VAL     HUGE_VALL<br>
&gt;&gt; +-#define SET_MANTISSA(flt, mant) \<br>
&gt;&gt; +-  do { union ieee854_long_double u;                                              \<br>
&gt;&gt; +-       u.d = (flt);                                                              \<br>
&gt;&gt; +-       u.ieee_nan.mantissa0 = 0;                                         \<br>
&gt;&gt; +-       u.ieee_nan.mantissa1 = 0;                                         \<br>
&gt;&gt; +-       u.ieee_nan.mantissa2 = (mant) &gt;&gt; 32;                                      \<br>
&gt;&gt; +-       u.ieee_nan.mantissa3 = (mant);                                            \<br>
&gt;&gt; +-       if ((u.ieee.mantissa0 | u.ieee.mantissa1                                  \<br>
&gt;&gt; +-       | u.ieee.mantissa2 | u.ieee.mantissa3) != 0)                      \<br>
&gt;&gt; +-    (flt) = u.d;                                                         \<br>
&gt;&gt; +-  } while (0)<br>
&gt;&gt; +<br>
&gt;&gt; + #include &lt;strtod_l.c&gt;<br>
&gt;&gt; +Index: git/sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- /dev/null<br>
&gt;&gt; ++++ git/sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h<br>
&gt;&gt; +@@ -0,0 +1,30 @@<br>
&gt;&gt; ++/* Convert string for NaN payload to corresponding NaN.  For ldbl-128ibm.<br>
&gt;&gt; ++   Copyright (C) 1997-2015 Free Software Foundation, Inc.<br>
&gt;&gt; ++   This file is part of the GNU C Library.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is free software; you can redistribute it and/or<br>
&gt;&gt; ++   modify it under the terms of the GNU Lesser General Public<br>
&gt;&gt; ++   License as published by the Free Software Foundation; either<br>
&gt;&gt; ++   version 2.1 of the License, or (at your option) any later version.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is distributed in the hope that it will be useful,<br>
&gt;&gt; ++   but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
&gt;&gt; ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
&gt;&gt; ++   Lesser General Public License for more details.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   You should have received a copy of the GNU Lesser General Public<br>
&gt;&gt; ++   License along with the GNU C Library; if not, see<br>
&gt;&gt; ++   &lt;<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>&gt;.  */<br>
&gt;&gt; ++<br>
&gt;&gt; ++#define FLOAT              long double<br>
&gt;&gt; ++#define SET_MANTISSA(flt, mant)                                    \<br>
&gt;&gt; ++  do                                                               \<br>
&gt;&gt; ++    {                                                              \<br>
&gt;&gt; ++      union ibm_extended_long_double u;                            \<br>
&gt;&gt; ++      u.ld = (flt);                                                \<br>
&gt;&gt; ++      u.d[0].ieee_nan.mantissa0 = (mant) &gt;&gt; 32;                    \<br>
&gt;&gt; ++      u.d[0].ieee_nan.mantissa1 = (mant);                  \<br>
&gt;&gt; ++      if ((u.d[0].ieee.mantissa0 | u.d[0].ieee.mantissa1) != 0)    \<br>
&gt;&gt; ++   (flt) = u.ld;                                           \<br>
&gt;&gt; ++    }                                                              \<br>
&gt;&gt; ++  while (0)<br>
&gt;&gt; +Index: git/sysdeps/ieee754/ldbl-128ibm/strtold_l.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/sysdeps/ieee754/ldbl-128ibm/strtold_l.c<br>
&gt;&gt; ++++ git/sysdeps/ieee754/ldbl-128ibm/strtold_l.c<br>
&gt;&gt; +@@ -30,25 +30,19 @@ extern long double ____new_wcstold_l (co<br>
&gt;&gt; + # define STRTOF            __new_wcstold_l<br>
&gt;&gt; + # define __STRTOF  ____new_wcstold_l<br>
&gt;&gt; + # define ____STRTOF_INTERNAL ____wcstold_l_internal<br>
&gt;&gt; ++# define STRTOF_NAN        __wcstold_nan<br>
&gt;&gt; + #else<br>
&gt;&gt; + extern long double ____new_strtold_l (const char *, char **, __locale_t);<br>
&gt;&gt; + # define STRTOF            __new_strtold_l<br>
&gt;&gt; + # define __STRTOF  ____new_strtold_l<br>
&gt;&gt; + # define ____STRTOF_INTERNAL ____strtold_l_internal<br>
&gt;&gt; ++# define STRTOF_NAN        __strtold_nan<br>
&gt;&gt; + #endif<br>
&gt;&gt; + extern __typeof (__STRTOF) STRTOF;<br>
&gt;&gt; + libc_hidden_proto (__STRTOF)<br>
&gt;&gt; + libc_hidden_proto (STRTOF)<br>
&gt;&gt; + #define MPN2FLOAT  __mpn_construct_long_double<br>
&gt;&gt; + #define FLOAT_HUGE_VAL     HUGE_VALL<br>
&gt;&gt; +-# define SET_MANTISSA(flt, mant) \<br>
&gt;&gt; +-  do { union ibm_extended_long_double u;                                 \<br>
&gt;&gt; +-       u.ld = (flt);                                                             \<br>
&gt;&gt; +-       u.d[0].ieee_nan.mantissa0 = (mant) &gt;&gt; 32;                         \<br>
&gt;&gt; +-       u.d[0].ieee_nan.mantissa1 = (mant);                               \<br>
&gt;&gt; +-       if ((u.d[0].ieee.mantissa0 | u.d[0].ieee.mantissa1) != 0)         \<br>
&gt;&gt; +-    (flt) = u.ld;                                                        \<br>
&gt;&gt; +-  } while (0)<br>
&gt;&gt; +<br>
&gt;&gt; + #include &lt;strtod_l.c&gt;<br>
&gt;&gt; +<br>
&gt;&gt; +Index: git/sysdeps/ieee754/ldbl-64-128/strtold_l.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/sysdeps/ieee754/ldbl-64-128/strtold_l.c<br>
&gt;&gt; ++++ git/sysdeps/ieee754/ldbl-64-128/strtold_l.c<br>
&gt;&gt; +@@ -30,28 +30,19 @@ extern long double ____new_wcstold_l (co<br>
&gt;&gt; + # define STRTOF            __new_wcstold_l<br>
&gt;&gt; + # define __STRTOF  ____new_wcstold_l<br>
&gt;&gt; + # define ____STRTOF_INTERNAL ____wcstold_l_internal<br>
&gt;&gt; ++# define STRTOF_NAN        __wcstold_nan<br>
&gt;&gt; + #else<br>
&gt;&gt; + extern long double ____new_strtold_l (const char *, char **, __locale_t);<br>
&gt;&gt; + # define STRTOF            __new_strtold_l<br>
&gt;&gt; + # define __STRTOF  ____new_strtold_l<br>
&gt;&gt; + # define ____STRTOF_INTERNAL ____strtold_l_internal<br>
&gt;&gt; ++# define STRTOF_NAN        __strtold_nan<br>
&gt;&gt; + #endif<br>
&gt;&gt; + extern __typeof (__STRTOF) STRTOF;<br>
&gt;&gt; + libc_hidden_proto (__STRTOF)<br>
&gt;&gt; + libc_hidden_proto (STRTOF)<br>
&gt;&gt; + #define MPN2FLOAT  __mpn_construct_long_double<br>
&gt;&gt; + #define FLOAT_HUGE_VAL     HUGE_VALL<br>
&gt;&gt; +-#define SET_MANTISSA(flt, mant) \<br>
&gt;&gt; +-  do { union ieee854_long_double u;                                              \<br>
&gt;&gt; +-       u.d = (flt);                                                              \<br>
&gt;&gt; +-       u.ieee_nan.mantissa0 = 0;                                         \<br>
&gt;&gt; +-       u.ieee_nan.mantissa1 = 0;                                         \<br>
&gt;&gt; +-       u.ieee_nan.mantissa2 = (mant) &gt;&gt; 32;                                      \<br>
&gt;&gt; +-       u.ieee_nan.mantissa3 = (mant);                                            \<br>
&gt;&gt; +-       if ((u.ieee.mantissa0 | u.ieee.mantissa1                                  \<br>
&gt;&gt; +-       | u.ieee.mantissa2 | u.ieee.mantissa3) != 0)                      \<br>
&gt;&gt; +-    (flt) = u.d;                                                         \<br>
&gt;&gt; +-  } while (0)<br>
&gt;&gt; +<br>
&gt;&gt; + #include &lt;strtod_l.c&gt;<br>
&gt;&gt; +<br>
&gt;&gt; +Index: git/sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- /dev/null<br>
&gt;&gt; ++++ git/sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h<br>
&gt;&gt; +@@ -0,0 +1,30 @@<br>
&gt;&gt; ++/* Convert string for NaN payload to corresponding NaN.  For ldbl-96.<br>
&gt;&gt; ++   Copyright (C) 1997-2015 Free Software Foundation, Inc.<br>
&gt;&gt; ++   This file is part of the GNU C Library.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is free software; you can redistribute it and/or<br>
&gt;&gt; ++   modify it under the terms of the GNU Lesser General Public<br>
&gt;&gt; ++   License as published by the Free Software Foundation; either<br>
&gt;&gt; ++   version 2.1 of the License, or (at your option) any later version.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is distributed in the hope that it will be useful,<br>
&gt;&gt; ++   but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
&gt;&gt; ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
&gt;&gt; ++   Lesser General Public License for more details.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   You should have received a copy of the GNU Lesser General Public<br>
&gt;&gt; ++   License along with the GNU C Library; if not, see<br>
&gt;&gt; ++   &lt;<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>&gt;.  */<br>
&gt;&gt; ++<br>
&gt;&gt; ++#define FLOAT              long double<br>
&gt;&gt; ++#define SET_MANTISSA(flt, mant)                            \<br>
&gt;&gt; ++  do                                                       \<br>
&gt;&gt; ++    {                                                      \<br>
&gt;&gt; ++      union ieee854_long_double u;                 \<br>
&gt;&gt; ++      u.d = (flt);                                 \<br>
&gt;&gt; ++      u.ieee_nan.mantissa0 = (mant) &gt;&gt; 32;         \<br>
&gt;&gt; ++      u.ieee_nan.mantissa1 = (mant);                       \<br>
&gt;&gt; ++      if ((u.ieee.mantissa0 | u.ieee.mantissa1) != 0)      \<br>
&gt;&gt; ++   (flt) = u.d;                                    \<br>
&gt;&gt; ++    }                                                      \<br>
&gt;&gt; ++  while (0)<br>
&gt;&gt; +Index: git/sysdeps/ieee754/ldbl-96/strtold_l.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/sysdeps/ieee754/ldbl-96/strtold_l.c<br>
&gt;&gt; ++++ git/sysdeps/ieee754/ldbl-96/strtold_l.c<br>
&gt;&gt; +@@ -25,19 +25,13 @@<br>
&gt;&gt; + #ifdef USE_WIDE_CHAR<br>
&gt;&gt; + # define STRTOF            wcstold_l<br>
&gt;&gt; + # define __STRTOF  __wcstold_l<br>
&gt;&gt; ++# define STRTOF_NAN        __wcstold_nan<br>
&gt;&gt; + #else<br>
&gt;&gt; + # define STRTOF            strtold_l<br>
&gt;&gt; + # define __STRTOF  __strtold_l<br>
&gt;&gt; ++# define STRTOF_NAN        __strtold_nan<br>
&gt;&gt; + #endif<br>
&gt;&gt; + #define MPN2FLOAT  __mpn_construct_long_double<br>
&gt;&gt; + #define FLOAT_HUGE_VAL     HUGE_VALL<br>
&gt;&gt; +-#define SET_MANTISSA(flt, mant) \<br>
&gt;&gt; +-  do { union ieee854_long_double u;                                              \<br>
&gt;&gt; +-       u.d = (flt);                                                              \<br>
&gt;&gt; +-       u.ieee_nan.mantissa0 = (mant) &gt;&gt; 32;                                      \<br>
&gt;&gt; +-       u.ieee_nan.mantissa1 = (mant);                                            \<br>
&gt;&gt; +-       if ((u.ieee.mantissa0 | u.ieee.mantissa1) != 0)                           \<br>
&gt;&gt; +-    (flt) = u.d;                                                         \<br>
&gt;&gt; +-  } while (0)<br>
&gt;&gt; +<br>
&gt;&gt; + #include &lt;stdlib/strtod_l.c&gt;<br>
&gt;&gt; +Index: git/wcsmbs/Makefile<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/wcsmbs/Makefile<br>
&gt;&gt; ++++ git/wcsmbs/Makefile<br>
&gt;&gt; +@@ -39,6 +39,7 @@ routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR<br>
&gt;&gt; +        wcstol wcstoul wcstoll wcstoull wcstod wcstold wcstof \<br>
&gt;&gt; +        wcstol_l wcstoul_l wcstoll_l wcstoull_l \<br>
&gt;&gt; +        wcstod_l wcstold_l wcstof_l \<br>
&gt;&gt; ++       wcstod_nan wcstold_nan wcstof_nan \<br>
&gt;&gt; +        wcscoll wcsxfrm \<br>
&gt;&gt; +        wcwidth wcswidth \<br>
&gt;&gt; +        wcscoll_l wcsxfrm_l \<br>
&gt;&gt; +Index: git/wcsmbs/wcstod_l.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/wcsmbs/wcstod_l.c<br>
&gt;&gt; ++++ git/wcsmbs/wcstod_l.c<br>
&gt;&gt; +@@ -23,9 +23,6 @@<br>
&gt;&gt; +<br>
&gt;&gt; + extern double ____wcstod_l_internal (const wchar_t *, wchar_t **, int,<br>
&gt;&gt; +                                 __locale_t);<br>
&gt;&gt; +-extern unsigned long long int ____wcstoull_l_internal (const wchar_t *,<br>
&gt;&gt; +-                                                  wchar_t **, int, int,<br>
&gt;&gt; +-                                                  __locale_t);<br>
&gt;&gt; +<br>
&gt;&gt; + #define    USE_WIDE_CHAR   1<br>
&gt;&gt; +<br>
&gt;&gt; +Index: git/wcsmbs/wcstod_nan.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- /dev/null<br>
&gt;&gt; ++++ git/wcsmbs/wcstod_nan.c<br>
&gt;&gt; +@@ -0,0 +1,23 @@<br>
&gt;&gt; ++/* Convert string for NaN payload to corresponding NaN.  Wide strings, double.<br>
&gt;&gt; ++   Copyright (C) 2015 Free Software Foundation, Inc.<br>
&gt;&gt; ++   This file is part of the GNU C Library.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is free software; you can redistribute it and/or<br>
&gt;&gt; ++   modify it under the terms of the GNU Lesser General Public<br>
&gt;&gt; ++   License as published by the Free Software Foundation; either<br>
&gt;&gt; ++   version 2.1 of the License, or (at your option) any later version.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is distributed in the hope that it will be useful,<br>
&gt;&gt; ++   but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
&gt;&gt; ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
&gt;&gt; ++   Lesser General Public License for more details.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   You should have received a copy of the GNU Lesser General Public<br>
&gt;&gt; ++   License along with the GNU C Library; if not, see<br>
&gt;&gt; ++   &lt;<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>&gt;.  */<br>
&gt;&gt; ++<br>
&gt;&gt; ++#include &quot;../stdlib/strtod_nan_wide.h&quot;<br>
&gt;&gt; ++#include &quot;../stdlib/strtod_nan_double.h&quot;<br>
&gt;&gt; ++<br>
&gt;&gt; ++#define STRTOD_NAN __wcstod_nan<br>
&gt;&gt; ++#include &quot;../stdlib/strtod_nan_main.c&quot;<br>
&gt;&gt; +Index: git/wcsmbs/wcstof_l.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/wcsmbs/wcstof_l.c<br>
&gt;&gt; ++++ git/wcsmbs/wcstof_l.c<br>
&gt;&gt; +@@ -25,8 +25,5 @@<br>
&gt;&gt; +<br>
&gt;&gt; + extern float ____wcstof_l_internal (const wchar_t *, wchar_t **, int,<br>
&gt;&gt; +                                __locale_t);<br>
&gt;&gt; +-extern unsigned long long int ____wcstoull_l_internal (const wchar_t *,<br>
&gt;&gt; +-                                                  wchar_t **, int, int,<br>
&gt;&gt; +-                                                  __locale_t);<br>
&gt;&gt; +<br>
&gt;&gt; + #include &lt;stdlib/strtof_l.c&gt;<br>
&gt;&gt; +Index: git/wcsmbs/wcstof_nan.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- /dev/null<br>
&gt;&gt; ++++ git/wcsmbs/wcstof_nan.c<br>
&gt;&gt; +@@ -0,0 +1,23 @@<br>
&gt;&gt; ++/* Convert string for NaN payload to corresponding NaN.  Wide strings, float.<br>
&gt;&gt; ++   Copyright (C) 2015 Free Software Foundation, Inc.<br>
&gt;&gt; ++   This file is part of the GNU C Library.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is free software; you can redistribute it and/or<br>
&gt;&gt; ++   modify it under the terms of the GNU Lesser General Public<br>
&gt;&gt; ++   License as published by the Free Software Foundation; either<br>
&gt;&gt; ++   version 2.1 of the License, or (at your option) any later version.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is distributed in the hope that it will be useful,<br>
&gt;&gt; ++   but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
&gt;&gt; ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
&gt;&gt; ++   Lesser General Public License for more details.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   You should have received a copy of the GNU Lesser General Public<br>
&gt;&gt; ++   License along with the GNU C Library; if not, see<br>
&gt;&gt; ++   &lt;<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>&gt;.  */<br>
&gt;&gt; ++<br>
&gt;&gt; ++#include &quot;../stdlib/strtod_nan_wide.h&quot;<br>
&gt;&gt; ++#include &quot;../stdlib/strtod_nan_float.h&quot;<br>
&gt;&gt; ++<br>
&gt;&gt; ++#define STRTOD_NAN __wcstof_nan<br>
&gt;&gt; ++#include &quot;../stdlib/strtod_nan_main.c&quot;<br>
&gt;&gt; +Index: git/wcsmbs/wcstold_l.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/wcsmbs/wcstold_l.c<br>
&gt;&gt; ++++ git/wcsmbs/wcstold_l.c<br>
&gt;&gt; +@@ -24,8 +24,5 @@<br>
&gt;&gt; +<br>
&gt;&gt; + extern long double ____wcstold_l_internal (const wchar_t *, wchar_t **, int,<br>
&gt;&gt; +                                       __locale_t);<br>
&gt;&gt; +-extern unsigned long long int ____wcstoull_l_internal (const wchar_t *,<br>
&gt;&gt; +-                                                  wchar_t **, int, int,<br>
&gt;&gt; +-                                                  __locale_t);<br>
&gt;&gt; +<br>
&gt;&gt; + #include &lt;strtold_l.c&gt;<br>
&gt;&gt; +Index: git/wcsmbs/wcstold_nan.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- /dev/null<br>
&gt;&gt; ++++ git/wcsmbs/wcstold_nan.c<br>
&gt;&gt; +@@ -0,0 +1,30 @@<br>
&gt;&gt; ++/* Convert string for NaN payload to corresponding NaN.  Wide strings,<br>
&gt;&gt; ++   long double.<br>
&gt;&gt; ++   Copyright (C) 2015 Free Software Foundation, Inc.<br>
&gt;&gt; ++   This file is part of the GNU C Library.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is free software; you can redistribute it and/or<br>
&gt;&gt; ++   modify it under the terms of the GNU Lesser General Public<br>
&gt;&gt; ++   License as published by the Free Software Foundation; either<br>
&gt;&gt; ++   version 2.1 of the License, or (at your option) any later version.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is distributed in the hope that it will be useful,<br>
&gt;&gt; ++   but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
&gt;&gt; ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
&gt;&gt; ++   Lesser General Public License for more details.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   You should have received a copy of the GNU Lesser General Public<br>
&gt;&gt; ++   License along with the GNU C Library; if not, see<br>
&gt;&gt; ++   &lt;<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>&gt;.  */<br>
&gt;&gt; ++<br>
&gt;&gt; ++#include &lt;math.h&gt;<br>
&gt;&gt; ++<br>
&gt;&gt; ++/* This function is unused if long double and double have the same<br>
&gt;&gt; ++   representation.  */<br>
&gt;&gt; ++#ifndef __NO_LONG_DOUBLE_MATH<br>
&gt;&gt; ++# include &quot;../stdlib/strtod_nan_wide.h&quot;<br>
&gt;&gt; ++# include &lt;strtod_nan_ldouble.h&gt;<br>
&gt;&gt; ++<br>
&gt;&gt; ++# define STRTOD_NAN __wcstold_nan<br>
&gt;&gt; ++# include &quot;../stdlib/strtod_nan_main.c&quot;<br>
&gt;&gt; ++#endif<br>
&gt;&gt; +Index: git/ChangeLog<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/ChangeLog<br>
&gt;&gt; ++++ git/ChangeLog<br>
&gt;&gt; +@@ -1,3 +1,57 @@<br>
&gt;&gt; ++2015-11-24  Joseph Myers  &lt;<a href="mailto:joseph@codesourcery.com">joseph@codesourcery.com</a>&gt;<br>
&gt;&gt; ++<br>
&gt;&gt; ++   * stdlib/strtod_nan.c: New file.<br>
&gt;&gt; ++   * stdlib/strtod_nan_double.h: Likewise.<br>
&gt;&gt; ++   * stdlib/strtod_nan_float.h: Likewise.<br>
&gt;&gt; ++   * stdlib/strtod_nan_main.c: Likewise.<br>
&gt;&gt; ++   * stdlib/strtod_nan_narrow.h: Likewise.<br>
&gt;&gt; ++   * stdlib/strtod_nan_wide.h: Likewise.<br>
&gt;&gt; ++   * stdlib/strtof_nan.c: Likewise.<br>
&gt;&gt; ++   * stdlib/strtold_nan.c: Likewise.<br>
&gt;&gt; ++   * sysdeps/ieee754/ldbl-128/strtod_nan_ldouble.h: Likewise.<br>
&gt;&gt; ++   * sysdeps/ieee754/ldbl-128ibm/strtod_nan_ldouble.h: Likewise.<br>
&gt;&gt; ++   * sysdeps/ieee754/ldbl-96/strtod_nan_ldouble.h: Likewise.<br>
&gt;&gt; ++   * wcsmbs/wcstod_nan.c: Likewise.<br>
&gt;&gt; ++   * wcsmbs/wcstof_nan.c: Likewise.<br>
&gt;&gt; ++   * wcsmbs/wcstold_nan.c: Likewise.<br>
&gt;&gt; ++   * stdlib/Makefile (routines): Add strtof_nan, strtod_nan and<br>
&gt;&gt; ++   strtold_nan.<br>
&gt;&gt; ++   * wcsmbs/Makefile (routines): Add wcstod_nan, wcstold_nan and<br>
&gt;&gt; ++   wcstof_nan.<br>
&gt;&gt; ++   * include/stdlib.h (__strtof_nan): Declare and use<br>
&gt;&gt; ++   libc_hidden_proto.<br>
&gt;&gt; ++   (__strtod_nan): Likewise.<br>
&gt;&gt; ++   (__strtold_nan): Likewise.<br>
&gt;&gt; ++   (__wcstof_nan): Likewise.<br>
&gt;&gt; ++   (__wcstod_nan): Likewise.<br>
&gt;&gt; ++   (__wcstold_nan): Likewise.<br>
&gt;&gt; ++   * include/wchar.h (____wcstoull_l_internal): Declare.<br>
&gt;&gt; ++   * stdlib/strtod_l.c: Do not include &lt;ieee754.h&gt;.<br>
&gt;&gt; ++   (____strtoull_l_internal): Remove declaration.<br>
&gt;&gt; ++   (STRTOF_NAN): Define macro.<br>
&gt;&gt; ++   (SET_MANTISSA): Remove macro.<br>
&gt;&gt; ++   (STRTOULL): Likewise.<br>
&gt;&gt; ++   (____STRTOF_INTERNAL): Use STRTOF_NAN to parse NaN payload.<br>
&gt;&gt; ++   * stdlib/strtof_l.c (____strtoull_l_internal): Remove declaration.<br>
&gt;&gt; ++   (STRTOF_NAN): Define macro.<br>
&gt;&gt; ++   (SET_MANTISSA): Remove macro.<br>
&gt;&gt; ++   * sysdeps/ieee754/ldbl-128/strtold_l.c (STRTOF_NAN): Define macro.<br>
&gt;&gt; ++   (SET_MANTISSA): Remove macro.<br>
&gt;&gt; ++   * sysdeps/ieee754/ldbl-128ibm/strtold_l.c (STRTOF_NAN): Define<br>
&gt;&gt; ++   macro.<br>
&gt;&gt; ++   (SET_MANTISSA): Remove macro.<br>
&gt;&gt; ++   * sysdeps/ieee754/ldbl-64-128/strtold_l.c (STRTOF_NAN): Define<br>
&gt;&gt; ++   macro.<br>
&gt;&gt; ++   (SET_MANTISSA): Remove macro.<br>
&gt;&gt; ++   * sysdeps/ieee754/ldbl-96/strtold_l.c (STRTOF_NAN): Define macro.<br>
&gt;&gt; ++   (SET_MANTISSA): Remove macro.<br>
&gt;&gt; ++   * wcsmbs/wcstod_l.c (____wcstoull_l_internal): Remove declaration.<br>
&gt;&gt; ++   * wcsmbs/wcstof_l.c (____wcstoull_l_internal): Likewise.<br>
&gt;&gt; ++   * wcsmbs/wcstold_l.c (____wcstoull_l_internal): Likewise.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   [BZ #19266]<br>
&gt;&gt; ++   * stdlib/strtod_l.c (____STRTOF_INTERNAL): Check directly for<br>
&gt;&gt; ++   upper case and lower case letters inside NAN(), not using TOLOWER.<br>
&gt;&gt; + 2015-08-08  Paul Pluzhnikov  &lt;<a href="mailto:ppluzhnikov@google.com">ppluzhnikov@google.com</a>&gt;<br>
&gt;&gt; +<br>
&gt;&gt; +    [BZ #17905]<br>
&gt;&gt; diff --git a/meta/recipes-core/glibc/glibc/CVE-2015-9761_2.patch b/meta/recipes-core/glibc/glibc/CVE-2015-9761_2.patch<br>
&gt;&gt; new file mode 100644<br>
&gt;&gt; index 0000000..0df5e50<br>
&gt;&gt; --- /dev/null<br>
&gt;&gt; +++ b/meta/recipes-core/glibc/glibc/CVE-2015-9761_2.patch<br>
&gt;&gt; @@ -0,0 +1,388 @@<br>
&gt;&gt; +From 8f5e8b01a1da2a207228f2072c934fa5918554b8 Mon Sep 17 00:00:00 2001<br>
&gt;&gt; +From: Joseph Myers &lt;<a href="mailto:joseph@codesourcery.com">joseph@codesourcery.com</a>&gt;<br>
&gt;&gt; +Date: Fri, 4 Dec 2015 20:36:28 +0000<br>
&gt;&gt; +Subject: [PATCH] Fix nan functions handling of payload strings (bug 16961, bug<br>
&gt;&gt; + 16962).<br>
&gt;&gt; +<br>
&gt;&gt; +The nan, nanf and nanl functions handle payload strings by doing e.g.:<br>
&gt;&gt; +<br>
&gt;&gt; +  if (tagp[0] != &#39;\0&#39;)<br>
&gt;&gt; +    {<br>
&gt;&gt; +      char buf[6 + strlen (tagp)];<br>
&gt;&gt; +      sprintf (buf, &quot;NAN(%s)&quot;, tagp);<br>
&gt;&gt; +      return strtod (buf, NULL);<br>
&gt;&gt; +    }<br>
&gt;&gt; +<br>
&gt;&gt; +This is an unbounded stack allocation based on the length of the<br>
&gt;&gt; +argument.  Furthermore, if the argument starts with an n-char-sequence<br>
&gt;&gt; +followed by &#39;)&#39;, that n-char-sequence is wrongly treated as<br>
&gt;&gt; +significant for determining the payload of the resulting NaN, when ISO<br>
&gt;&gt; +C says the call should be equivalent to strtod (&quot;NAN&quot;, NULL), without<br>
&gt;&gt; +being affected by that initial n-char-sequence.  This patch fixes both<br>
&gt;&gt; +those problems by using the __strtod_nan etc. functions recently<br>
&gt;&gt; +factored out of strtod etc. for that purpose, with those functions<br>
&gt;&gt; +being exported from libc at version GLIBC_PRIVATE.<br>
&gt;&gt; +<br>
&gt;&gt; +Tested for x86_64, x86, mips64 and powerpc.<br>
&gt;&gt; +<br>
&gt;&gt; +    [BZ #16961]<br>
&gt;&gt; +    [BZ #16962]<br>
&gt;&gt; +    * math/s_nan.c (__nan): Use __strtod_nan instead of constructing a<br>
&gt;&gt; +    string on the stack for strtod.<br>
&gt;&gt; +    * math/s_nanf.c (__nanf): Use __strtof_nan instead of constructing<br>
&gt;&gt; +    a string on the stack for strtof.<br>
&gt;&gt; +    * math/s_nanl.c (__nanl): Use __strtold_nan instead of<br>
&gt;&gt; +    constructing a string on the stack for strtold.<br>
&gt;&gt; +    * stdlib/Versions (libc): Add __strtof_nan, __strtod_nan and<br>
&gt;&gt; +    __strtold_nan to GLIBC_PRIVATE.<br>
&gt;&gt; +    * math/test-nan-overflow.c: New file.<br>
&gt;&gt; +    * math/test-nan-payload.c: Likewise.<br>
&gt;&gt; +    * math/Makefile (tests): Add test-nan-overflow and<br>
&gt;&gt; +    test-nan-payload.<br>
&gt;&gt; +<br>
&gt;&gt; +Upstream-Status: Backport<br>
&gt;&gt; +CVE: CVE-2015-9761 patch #2<br>
&gt;&gt; +[Yocto # 8980]<br>
&gt;&gt; +<br>
&gt;&gt; +<a href="https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8f5e8b01a1da2a207228f2072c934fa5918554b8" rel="noreferrer" target="_blank">https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8f5e8b01a1da2a207228f2072c934fa5918554b8</a><br>
&gt;&gt; +<br>
&gt;&gt; +Signed-off-by: Armin Kuster &lt;<a href="mailto:akuster@mvista.com">akuster@mvista.com</a>&gt;<br>
&gt;&gt; +<br>
&gt;&gt; +---<br>
&gt;&gt; + ChangeLog                |  17 +++++++<br>
&gt;&gt; + NEWS                     |   6 +++<br>
&gt;&gt; + math/Makefile            |   3 +-<br>
&gt;&gt; + math/s_nan.c             |   9 +---<br>
&gt;&gt; + math/s_nanf.c            |   9 +---<br>
&gt;&gt; + math/s_nanl.c            |   9 +---<br>
&gt;&gt; + math/test-nan-overflow.c |  66 +++++++++++++++++++++++++<br>
&gt;&gt; + math/test-nan-payload.c  | 122 +++++++++++++++++++++++++++++++++++++++++++++++<br>
&gt;&gt; + stdlib/Versions          |   1 +<br>
&gt;&gt; + 9 files changed, 217 insertions(+), 25 deletions(-)<br>
&gt;&gt; + create mode 100644 math/test-nan-overflow.c<br>
&gt;&gt; + create mode 100644 math/test-nan-payload.c<br>
&gt;&gt; +<br>
&gt;&gt; +Index: git/ChangeLog<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/ChangeLog<br>
&gt;&gt; ++++ git/ChangeLog<br>
&gt;&gt; +@@ -1,3 +1,20 @@<br>
&gt;&gt; ++2015-12-04  Joseph Myers  &lt;<a href="mailto:joseph@codesourcery.com">joseph@codesourcery.com</a>&gt;<br>
&gt;&gt; ++<br>
&gt;&gt; ++   [BZ #16961]<br>
&gt;&gt; ++   [BZ #16962]<br>
&gt;&gt; ++   * math/s_nan.c (__nan): Use __strtod_nan instead of constructing a<br>
&gt;&gt; ++   string on the stack for strtod.<br>
&gt;&gt; ++   * math/s_nanf.c (__nanf): Use __strtof_nan instead of constructing<br>
&gt;&gt; ++   a string on the stack for strtof.<br>
&gt;&gt; ++   * math/s_nanl.c (__nanl): Use __strtold_nan instead of<br>
&gt;&gt; ++   constructing a string on the stack for strtold.<br>
&gt;&gt; ++   * stdlib/Versions (libc): Add __strtof_nan, __strtod_nan and<br>
&gt;&gt; ++   __strtold_nan to GLIBC_PRIVATE.<br>
&gt;&gt; ++   * math/test-nan-overflow.c: New file.<br>
&gt;&gt; ++   * math/test-nan-payload.c: Likewise.<br>
&gt;&gt; ++   * math/Makefile (tests): Add test-nan-overflow and<br>
&gt;&gt; ++   test-nan-payload.<br>
&gt;&gt; ++<br>
&gt;&gt; + 2015-11-24  Joseph Myers  &lt;<a href="mailto:joseph@codesourcery.com">joseph@codesourcery.com</a>&gt;<br>
&gt;&gt; +<br>
&gt;&gt; +    * stdlib/strtod_nan.c: New file.<br>
&gt;&gt; +Index: git/NEWS<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/NEWS<br>
&gt;&gt; ++++ git/NEWS<br>
&gt;&gt; +@@ -7,6 +7,12 @@ using `glibc&#39; in the &quot;product&quot; field.<br>
&gt;&gt; +<br>
&gt;&gt; + Version 2.21<br>
&gt;&gt; +<br>
&gt;&gt; ++Security related changes:<br>
&gt;&gt; ++<br>
&gt;&gt; ++* The nan, nanf and nanl functions no longer have unbounded stack usage<br>
&gt;&gt; ++  depending on the length of the string passed as an argument to the<br>
&gt;&gt; ++  functions.  Reported by Joseph Myers.<br>
&gt;&gt; ++<br>
&gt;&gt; + * The following bugs are resolved with this release:<br>
&gt;&gt; +<br>
&gt;&gt; +   6652, 10672, 12674, 12847, 12926, 13862, 14132, 14138, 14171, 14498,<br>
&gt;&gt; +Index: git/math/s_nan.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/math/s_nan.c<br>
&gt;&gt; ++++ git/math/s_nan.c<br>
&gt;&gt; +@@ -28,14 +28,7 @@<br>
&gt;&gt; + double<br>
&gt;&gt; + __nan (const char *tagp)<br>
&gt;&gt; + {<br>
&gt;&gt; +-  if (tagp[0] != &#39;\0&#39;)<br>
&gt;&gt; +-    {<br>
&gt;&gt; +-      char buf[6 + strlen (tagp)];<br>
&gt;&gt; +-      sprintf (buf, &quot;NAN(%s)&quot;, tagp);<br>
&gt;&gt; +-      return strtod (buf, NULL);<br>
&gt;&gt; +-    }<br>
&gt;&gt; +-<br>
&gt;&gt; +-  return NAN;<br>
&gt;&gt; ++  return __strtod_nan (tagp, NULL, 0);<br>
&gt;&gt; + }<br>
&gt;&gt; + weak_alias (__nan, nan)<br>
&gt;&gt; + #ifdef NO_LONG_DOUBLE<br>
&gt;&gt; +Index: git/math/s_nanf.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/math/s_nanf.c<br>
&gt;&gt; ++++ git/math/s_nanf.c<br>
&gt;&gt; +@@ -28,13 +28,6 @@<br>
&gt;&gt; + float<br>
&gt;&gt; + __nanf (const char *tagp)<br>
&gt;&gt; + {<br>
&gt;&gt; +-  if (tagp[0] != &#39;\0&#39;)<br>
&gt;&gt; +-    {<br>
&gt;&gt; +-      char buf[6 + strlen (tagp)];<br>
&gt;&gt; +-      sprintf (buf, &quot;NAN(%s)&quot;, tagp);<br>
&gt;&gt; +-      return strtof (buf, NULL);<br>
&gt;&gt; +-    }<br>
&gt;&gt; +-<br>
&gt;&gt; +-  return NAN;<br>
&gt;&gt; ++  return __strtof_nan (tagp, NULL, 0);<br>
&gt;&gt; + }<br>
&gt;&gt; + weak_alias (__nanf, nanf)<br>
&gt;&gt; +Index: git/math/s_nanl.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/math/s_nanl.c<br>
&gt;&gt; ++++ git/math/s_nanl.c<br>
&gt;&gt; +@@ -28,13 +28,6 @@<br>
&gt;&gt; + long double<br>
&gt;&gt; + __nanl (const char *tagp)<br>
&gt;&gt; + {<br>
&gt;&gt; +-  if (tagp[0] != &#39;\0&#39;)<br>
&gt;&gt; +-    {<br>
&gt;&gt; +-      char buf[6 + strlen (tagp)];<br>
&gt;&gt; +-      sprintf (buf, &quot;NAN(%s)&quot;, tagp);<br>
&gt;&gt; +-      return strtold (buf, NULL);<br>
&gt;&gt; +-    }<br>
&gt;&gt; +-<br>
&gt;&gt; +-  return NAN;<br>
&gt;&gt; ++  return __strtold_nan (tagp, NULL, 0);<br>
&gt;&gt; + }<br>
&gt;&gt; + weak_alias (__nanl, nanl)<br>
&gt;&gt; +Index: git/math/test-nan-overflow.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- /dev/null<br>
&gt;&gt; ++++ git/math/test-nan-overflow.c<br>
&gt;&gt; +@@ -0,0 +1,66 @@<br>
&gt;&gt; ++/* Test nan functions stack overflow (bug 16962).<br>
&gt;&gt; ++   Copyright (C) 2015 Free Software Foundation, Inc.<br>
&gt;&gt; ++   This file is part of the GNU C Library.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is free software; you can redistribute it and/or<br>
&gt;&gt; ++   modify it under the terms of the GNU Lesser General Public<br>
&gt;&gt; ++   License as published by the Free Software Foundation; either<br>
&gt;&gt; ++   version 2.1 of the License, or (at your option) any later version.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is distributed in the hope that it will be useful,<br>
&gt;&gt; ++   but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
&gt;&gt; ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
&gt;&gt; ++   Lesser General Public License for more details.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   You should have received a copy of the GNU Lesser General Public<br>
&gt;&gt; ++   License along with the GNU C Library; if not, see<br>
&gt;&gt; ++   &lt;<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>&gt;.  */<br>
&gt;&gt; ++<br>
&gt;&gt; ++#include &lt;math.h&gt;<br>
&gt;&gt; ++#include &lt;stdio.h&gt;<br>
&gt;&gt; ++#include &lt;string.h&gt;<br>
&gt;&gt; ++#include &lt;sys/resource.h&gt;<br>
&gt;&gt; ++<br>
&gt;&gt; ++#define STACK_LIM 1048576<br>
&gt;&gt; ++#define STRING_SIZE (2 * STACK_LIM)<br>
&gt;&gt; ++<br>
&gt;&gt; ++static int<br>
&gt;&gt; ++do_test (void)<br>
&gt;&gt; ++{<br>
&gt;&gt; ++  int result = 0;<br>
&gt;&gt; ++  struct rlimit lim;<br>
&gt;&gt; ++  getrlimit (RLIMIT_STACK, &amp;lim);<br>
&gt;&gt; ++  lim.rlim_cur = STACK_LIM;<br>
&gt;&gt; ++  setrlimit (RLIMIT_STACK, &amp;lim);<br>
&gt;&gt; ++  char *nanstr = malloc (STRING_SIZE);<br>
&gt;&gt; ++  if (nanstr == NULL)<br>
&gt;&gt; ++    {<br>
&gt;&gt; ++      puts (&quot;malloc failed, cannot test&quot;);<br>
&gt;&gt; ++      return 77;<br>
&gt;&gt; ++    }<br>
&gt;&gt; ++  memset (nanstr, &#39;0&#39;, STRING_SIZE - 1);<br>
&gt;&gt; ++  nanstr[STRING_SIZE - 1] = 0;<br>
&gt;&gt; ++#define NAN_TEST(TYPE, FUNC)                       \<br>
&gt;&gt; ++  do                                               \<br>
&gt;&gt; ++    {                                              \<br>
&gt;&gt; ++      char *volatile p = nanstr;           \<br>
&gt;&gt; ++      volatile TYPE v = FUNC (p);          \<br>
&gt;&gt; ++      if (isnan (v))                               \<br>
&gt;&gt; ++   puts (&quot;PASS: &quot; #FUNC);                  \<br>
&gt;&gt; ++      else                                 \<br>
&gt;&gt; ++   {                                       \<br>
&gt;&gt; ++     puts (&quot;FAIL: &quot; #FUNC);                \<br>
&gt;&gt; ++     result = 1;                           \<br>
&gt;&gt; ++   }                                       \<br>
&gt;&gt; ++    }                                              \<br>
&gt;&gt; ++  while (0)<br>
&gt;&gt; ++  NAN_TEST (float, nanf);<br>
&gt;&gt; ++  NAN_TEST (double, nan);<br>
&gt;&gt; ++#ifndef NO_LONG_DOUBLE<br>
&gt;&gt; ++  NAN_TEST (long double, nanl);<br>
&gt;&gt; ++#endif<br>
&gt;&gt; ++  return result;<br>
&gt;&gt; ++}<br>
&gt;&gt; ++<br>
&gt;&gt; ++#define TEST_FUNCTION do_test ()<br>
&gt;&gt; ++#include &quot;../test-skeleton.c&quot;<br>
&gt;&gt; +Index: git/math/test-nan-payload.c<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- /dev/null<br>
&gt;&gt; ++++ git/math/test-nan-payload.c<br>
&gt;&gt; +@@ -0,0 +1,122 @@<br>
&gt;&gt; ++/* Test nan functions payload handling (bug 16961).<br>
&gt;&gt; ++   Copyright (C) 2015 Free Software Foundation, Inc.<br>
&gt;&gt; ++   This file is part of the GNU C Library.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is free software; you can redistribute it and/or<br>
&gt;&gt; ++   modify it under the terms of the GNU Lesser General Public<br>
&gt;&gt; ++   License as published by the Free Software Foundation; either<br>
&gt;&gt; ++   version 2.1 of the License, or (at your option) any later version.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   The GNU C Library is distributed in the hope that it will be useful,<br>
&gt;&gt; ++   but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
&gt;&gt; ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
&gt;&gt; ++   Lesser General Public License for more details.<br>
&gt;&gt; ++<br>
&gt;&gt; ++   You should have received a copy of the GNU Lesser General Public<br>
&gt;&gt; ++   License along with the GNU C Library; if not, see<br>
&gt;&gt; ++   &lt;<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>&gt;.  */<br>
&gt;&gt; ++<br>
&gt;&gt; ++#include &lt;float.h&gt;<br>
&gt;&gt; ++#include &lt;math.h&gt;<br>
&gt;&gt; ++#include &lt;stdio.h&gt;<br>
&gt;&gt; ++#include &lt;stdlib.h&gt;<br>
&gt;&gt; ++#include &lt;string.h&gt;<br>
&gt;&gt; ++<br>
&gt;&gt; ++/* Avoid built-in functions.  */<br>
&gt;&gt; ++#define WRAP_NAN(FUNC, STR) \<br>
&gt;&gt; ++  ({ const char *volatile wns = (STR); FUNC (wns); })<br>
&gt;&gt; ++#define WRAP_STRTO(FUNC, STR) \<br>
&gt;&gt; ++  ({ const char *volatile wss = (STR); FUNC (wss, NULL); })<br>
&gt;&gt; ++<br>
&gt;&gt; ++#define CHECK_IS_NAN(TYPE, A)                      \<br>
&gt;&gt; ++  do                                               \<br>
&gt;&gt; ++    {                                              \<br>
&gt;&gt; ++      if (isnan (A))                               \<br>
&gt;&gt; ++   puts (&quot;PASS: &quot; #TYPE &quot; &quot; #A);           \<br>
&gt;&gt; ++      else                                 \<br>
&gt;&gt; ++   {                                       \<br>
&gt;&gt; ++     puts (&quot;FAIL: &quot; #TYPE &quot; &quot; #A);         \<br>
&gt;&gt; ++     result = 1;                           \<br>
&gt;&gt; ++   }                                       \<br>
&gt;&gt; ++    }                                              \<br>
&gt;&gt; ++  while (0)<br>
&gt;&gt; ++<br>
&gt;&gt; ++#define CHECK_SAME_NAN(TYPE, A, B)                 \<br>
&gt;&gt; ++  do                                                       \<br>
&gt;&gt; ++    {                                                      \<br>
&gt;&gt; ++      if (memcmp (&amp;(A), &amp;(B), sizeof (A)) == 0)            \<br>
&gt;&gt; ++   puts (&quot;PASS: &quot; #TYPE &quot; &quot; #A &quot; = &quot; #B);          \<br>
&gt;&gt; ++      else                                         \<br>
&gt;&gt; ++   {                                               \<br>
&gt;&gt; ++     puts (&quot;FAIL: &quot; #TYPE &quot; &quot; #A &quot; = &quot; #B);        \<br>
&gt;&gt; ++     result = 1;                                   \<br>
&gt;&gt; ++   }                                               \<br>
&gt;&gt; ++    }                                                      \<br>
&gt;&gt; ++  while (0)<br>
&gt;&gt; ++<br>
&gt;&gt; ++#define CHECK_DIFF_NAN(TYPE, A, B)                 \<br>
&gt;&gt; ++  do                                                       \<br>
&gt;&gt; ++    {                                                      \<br>
&gt;&gt; ++      if (memcmp (&amp;(A), &amp;(B), sizeof (A)) != 0)            \<br>
&gt;&gt; ++   puts (&quot;PASS: &quot; #TYPE &quot; &quot; #A &quot; != &quot; #B);         \<br>
&gt;&gt; ++      else                                         \<br>
&gt;&gt; ++   {                                               \<br>
&gt;&gt; ++     puts (&quot;FAIL: &quot; #TYPE &quot; &quot; #A &quot; != &quot; #B);       \<br>
&gt;&gt; ++     result = 1;                                   \<br>
&gt;&gt; ++   }                                               \<br>
&gt;&gt; ++    }                                                      \<br>
&gt;&gt; ++  while (0)<br>
&gt;&gt; ++<br>
&gt;&gt; ++/* Cannot test payloads by memcmp for formats where NaNs have padding<br>
&gt;&gt; ++   bits.  */<br>
&gt;&gt; ++#define CAN_TEST_EQ(MANT_DIG) ((MANT_DIG) != 64 &amp;&amp; (MANT_DIG) != 106)<br>
&gt;&gt; ++<br>
&gt;&gt; ++#define RUN_TESTS(TYPE, SFUNC, FUNC, MANT_DIG)             \<br>
&gt;&gt; ++  do                                                       \<br>
&gt;&gt; ++    {                                                      \<br>
&gt;&gt; ++     TYPE n123 = WRAP_NAN (FUNC, &quot;123&quot;);           \<br>
&gt;&gt; ++     CHECK_IS_NAN (TYPE, n123);                            \<br>
&gt;&gt; ++     TYPE s123 = WRAP_STRTO (SFUNC, &quot;NAN(123)&quot;);   \<br>
&gt;&gt; ++     CHECK_IS_NAN (TYPE, s123);                            \<br>
&gt;&gt; ++     TYPE n456 = WRAP_NAN (FUNC, &quot;456&quot;);           \<br>
&gt;&gt; ++     CHECK_IS_NAN (TYPE, n456);                            \<br>
&gt;&gt; ++     TYPE s456 = WRAP_STRTO (SFUNC, &quot;NAN(456)&quot;);   \<br>
&gt;&gt; ++     CHECK_IS_NAN (TYPE, s456);                            \<br>
&gt;&gt; ++     TYPE n123x = WRAP_NAN (FUNC, &quot;123)&quot;);         \<br>
&gt;&gt; ++     CHECK_IS_NAN (TYPE, n123x);                   \<br>
&gt;&gt; ++     TYPE nemp = WRAP_NAN (FUNC, &quot;&quot;);                      \<br>
&gt;&gt; ++     CHECK_IS_NAN (TYPE, nemp);                            \<br>
&gt;&gt; ++     TYPE semp = WRAP_STRTO (SFUNC, &quot;NAN()&quot;);              \<br>
&gt;&gt; ++     CHECK_IS_NAN (TYPE, semp);                            \<br>
&gt;&gt; ++     TYPE sx = WRAP_STRTO (SFUNC, &quot;NAN&quot;);          \<br>
&gt;&gt; ++     CHECK_IS_NAN (TYPE, sx);                              \<br>
&gt;&gt; ++     if (CAN_TEST_EQ (MANT_DIG))                   \<br>
&gt;&gt; ++       CHECK_SAME_NAN (TYPE, n123, s123);          \<br>
&gt;&gt; ++     if (CAN_TEST_EQ (MANT_DIG))                   \<br>
&gt;&gt; ++       CHECK_SAME_NAN (TYPE, n456, s456);          \<br>
&gt;&gt; ++     if (CAN_TEST_EQ (MANT_DIG))                   \<br>
&gt;&gt; ++       CHECK_SAME_NAN (TYPE, nemp, semp);          \<br>
&gt;&gt; ++     if (CAN_TEST_EQ (MANT_DIG))                   \<br>
&gt;&gt; ++       CHECK_SAME_NAN (TYPE, n123x, sx);           \<br>
&gt;&gt; ++     CHECK_DIFF_NAN (TYPE, n123, n456);                    \<br>
&gt;&gt; ++     CHECK_DIFF_NAN (TYPE, n123, nemp);                    \<br>
&gt;&gt; ++     CHECK_DIFF_NAN (TYPE, n123, n123x);           \<br>
&gt;&gt; ++     CHECK_DIFF_NAN (TYPE, n456, nemp);                    \<br>
&gt;&gt; ++     CHECK_DIFF_NAN (TYPE, n456, n123x);           \<br>
&gt;&gt; ++    }                                                      \<br>
&gt;&gt; ++  while (0)<br>
&gt;&gt; ++<br>
&gt;&gt; ++static int<br>
&gt;&gt; ++do_test (void)<br>
&gt;&gt; ++{<br>
&gt;&gt; ++  int result = 0;<br>
&gt;&gt; ++  RUN_TESTS (float, strtof, nanf, FLT_MANT_DIG);<br>
&gt;&gt; ++  RUN_TESTS (double, strtod, nan, DBL_MANT_DIG);<br>
&gt;&gt; ++#ifndef NO_LONG_DOUBLE<br>
&gt;&gt; ++  RUN_TESTS (long double, strtold, nanl, LDBL_MANT_DIG);<br>
&gt;&gt; ++#endif<br>
&gt;&gt; ++  return result;<br>
&gt;&gt; ++}<br>
&gt;&gt; ++<br>
&gt;&gt; ++#define TEST_FUNCTION do_test ()<br>
&gt;&gt; ++#include &quot;../test-skeleton.c&quot;<br>
&gt;&gt; +Index: git/stdlib/Versions<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/stdlib/Versions<br>
&gt;&gt; ++++ git/stdlib/Versions<br>
&gt;&gt; +@@ -118,5 +118,6 @@ libc {<br>
&gt;&gt; +     # Used from other libraries<br>
&gt;&gt; +     __libc_secure_getenv;<br>
&gt;&gt; +     __call_tls_dtors;<br>
&gt;&gt; ++    __strtof_nan; __strtod_nan; __strtold_nan;<br>
&gt;&gt; +   }<br>
&gt;&gt; + }<br>
&gt;&gt; +Index: git/math/Makefile<br>
&gt;&gt; +===================================================================<br>
&gt;&gt; +--- git.orig/math/Makefile<br>
&gt;&gt; ++++ git/math/Makefile<br>
&gt;&gt; +@@ -92,7 +92,9 @@ tests = test-matherr test-fenv atest-exp<br>
&gt;&gt; +    test-misc test-fpucw test-fpucw-ieee tst-definitions test-tgmath \<br>
&gt;&gt; +    test-tgmath-ret bug-nextafter bug-nexttoward bug-tgmath1 \<br>
&gt;&gt; +    test-tgmath-int test-tgmath2 test-powl tst-CMPLX tst-CMPLX2 test-snan \<br>
&gt;&gt; +-   test-fenv-tls test-fenv-preserve test-fenv-return $(tests-static)<br>
&gt;&gt; ++   test-fenv-tls test-fenv-preserve test-fenv-return \<br>
&gt;&gt; ++    test-nan-overflow test-nan-payload \<br>
&gt;&gt; ++    $(tests-static)<br>
&gt;&gt; + tests-static = test-fpucw-static test-fpucw-ieee-static<br>
&gt;&gt; + # We do the `long double&#39; tests only if this data type is available and<br>
&gt;&gt; + # distinct from `double&#39;.<br>
&gt;&gt; diff --git a/meta/recipes-core/glibc/<a href="http://glibc_2.20.bb" rel="noreferrer" target="_blank">glibc_2.20.bb</a> b/meta/recipes-core/glibc/<a href="http://glibc_2.20.bb" rel="noreferrer" target="_blank">glibc_2.20.bb</a><br>
&gt;&gt; index af568d9..d099d5d 100644<br>
&gt;&gt; --- a/meta/recipes-core/glibc/<a href="http://glibc_2.20.bb" rel="noreferrer" target="_blank">glibc_2.20.bb</a><br>
&gt;&gt; +++ b/meta/recipes-core/glibc/<a href="http://glibc_2.20.bb" rel="noreferrer" target="_blank">glibc_2.20.bb</a><br>
&gt;&gt; @@ -50,6 +50,8 @@ CVEPATCHES = &quot;\<br>
&gt;&gt;          file://CVE-2015-7547.patch \<br>
&gt;&gt;          file://CVE-2015-8777.patch \<br>
&gt;&gt;          file://CVE-2015-8779.patch \<br>
&gt;&gt; +        file://CVE-2015-9761_1.patch \<br>
&gt;&gt; +        file://CVE-2015-9761_2.patch \<br>
&gt;&gt;  &quot;<br>
&gt;&gt;<br>
&gt;&gt;  LIC_FILES_CHKSUM = &quot;file://LICENSES;md5=e9a558e243b36d3209f380deb394b213 \<br>
&gt;&gt; --<br>
&gt;&gt; 2.3.5<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Openembedded-core mailing list<br>
&gt;&gt; <a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.openembedded.org</a><br>
&gt;&gt; <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
&gt;<br>
</div></div></blockquote></div><br></div>