iconv: Mangle __btowc_fct even without __init_fct [BZ #22025]

This commit is contained in:
Florian Weimer 2017-08-29 16:51:20 +02:00
parent 7daada0319
commit e7c18b9d0a
2 changed files with 20 additions and 13 deletions

View File

@ -1,3 +1,13 @@
2017-08-29 Florian Weimer <fweimer@redhat.com>
[BZ #22025]
* iconv/gconv_db.c (free_derivation): Remove redundant
parentheses.
(gen_steps): Unconditionally mangle __btowc_fct after
initialization.
(increment_counter): Likewise. Do not call init_fct for internal
modules.
2017-08-29 Joseph Myers <joseph@codesourcery.com> 2017-08-29 Joseph Myers <joseph@codesourcery.com>
[BZ #22028] [BZ #22028]

View File

@ -179,8 +179,8 @@ free_derivation (void *p)
size_t cnt; size_t cnt;
for (cnt = 0; cnt < deriv->nsteps; ++cnt) for (cnt = 0; cnt < deriv->nsteps; ++cnt)
if ((deriv->steps[cnt].__counter > 0) if (deriv->steps[cnt].__counter > 0
&& (deriv->steps[cnt].__shlib_handle != NULL)) && deriv->steps[cnt].__shlib_handle != NULL)
{ {
__gconv_end_fct end_fct = deriv->steps[cnt].__end_fct; __gconv_end_fct end_fct = deriv->steps[cnt].__end_fct;
#ifdef PTR_DEMANGLE #ifdef PTR_DEMANGLE
@ -323,11 +323,10 @@ gen_steps (struct derivation_step *best, const char *toset,
result[step_cnt].__end_fct = NULL; result[step_cnt].__end_fct = NULL;
break; break;
} }
# ifdef PTR_MANGLE
PTR_MANGLE (result[step_cnt].__btowc_fct);
# endif
} }
# ifdef PTR_MANGLE
PTR_MANGLE (result[step_cnt].__btowc_fct);
# endif
} }
else else
#endif #endif
@ -403,16 +402,14 @@ increment_counter (struct __gconv_step *steps, size_t nsteps)
/* These settings can be overridden by the init function. */ /* These settings can be overridden by the init function. */
step->__btowc_fct = NULL; step->__btowc_fct = NULL;
}
/* Call the init function. */ /* Call the init function. */
__gconv_init_fct init_fct = step->__init_fct; __gconv_init_fct init_fct = step->__init_fct;
#ifdef PTR_DEMANGLE #ifdef PTR_DEMANGLE
PTR_DEMANGLE (init_fct); PTR_DEMANGLE (init_fct);
#endif #endif
if (init_fct != NULL) if (init_fct != NULL)
{ DL_CALL_FCT (init_fct, (step));
DL_CALL_FCT (init_fct, (step));
#ifdef PTR_MANGLE #ifdef PTR_MANGLE
PTR_MANGLE (step->__btowc_fct); PTR_MANGLE (step->__btowc_fct);