core, pulse, modules: Fix undefined behavior with array subscript of invalid type

From the NetBSD manual:

     The first argument of these functions is of type int, but only a very
     restricted subset of values are actually valid.  The argument must either
     be the value of the macro EOF (which has a negative value), or must be a
     non-negative value within the range representable as unsigned char.
     Passing invalid values leads to undefined behavior.

     --  ctype(3)
This commit is contained in:
Kamil Rytarowski 2015-11-20 04:20:36 +01:00 committed by Arun Raghavan
parent 9dd77827ad
commit 93cccdee8d
5 changed files with 15 additions and 15 deletions

View file

@ -53,7 +53,7 @@ pa_void_func_t pa_load_sym(lt_dlhandle handle, const char *module, const char *s
sn = pa_sprintf_malloc("%s_LTX_%s", module, symbol);
for (c = sn; *c; c++)
if (!isalnum(*c))
if (!isalnum((unsigned char)*c))
*c = '_';
f = (pa_void_func_t) lt_dlsym(handle, sn);