[PATCH] Mangle NULL pointers in iconv/gconv [BZ #22025]

Florian Weimer fweimer@redhat.com
Tue Aug 29 14:13:00 GMT 2017


*sigh*

Right after pushing I realized that the entire premise of this patch is
bogus.

Code like this:

  /* Get the conversion functions.  */
  fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE));
  __gconv_btowc_fct btowc_fct = fcts->towc->__btowc_fct;
#ifdef PTR_DEMANGLE
  if (fcts->towc->__shlib_handle != NULL)
    PTR_DEMANGLE (btowc_fct);
#endif

  if (__builtin_expect (fcts->towc_nsteps == 1, 1)
      && __builtin_expect (btowc_fct != NULL, 1))
    {
      /* Use the shortcut function.  */
      return DL_CALL_FCT (btowc_fct, (fcts->towc, (unsigned char) c));

provides a reasonably straightforward way for bypassing pointer
mangling, simply by setting __shlib_handle to NULL.

I'll try to come up with a different fix.

Florian



More information about the Libc-alpha mailing list