authd: Avoid negative array indices
This commit is contained in:
parent
7445ece1d1
commit
1729f46eab
3 changed files with 4 additions and 4 deletions
|
@ -136,7 +136,7 @@ load_provider(struct auth_provider *provider)
|
|||
}
|
||||
|
||||
if(provider->stats_handler.letter != '\0')
|
||||
authd_stat_handlers[provider->stats_handler.letter] = provider->stats_handler.handler;
|
||||
authd_stat_handlers[(unsigned char)provider->stats_handler.letter] = provider->stats_handler.handler;
|
||||
|
||||
if(provider->init != NULL)
|
||||
provider->init();
|
||||
|
@ -156,7 +156,7 @@ unload_provider(struct auth_provider *provider)
|
|||
}
|
||||
|
||||
if(provider->stats_handler.letter != '\0')
|
||||
authd_stat_handlers[provider->stats_handler.letter] = NULL;
|
||||
authd_stat_handlers[(unsigned char)provider->stats_handler.letter] = NULL;
|
||||
|
||||
if(provider->destroy != NULL)
|
||||
provider->destroy();
|
||||
|
|
|
@ -284,7 +284,7 @@ parse_authd_reply(rb_helper * helper)
|
|||
struct authd_cb *cmd;
|
||||
|
||||
parc = rb_string_to_array(buf, parv, MAXPARA+1);
|
||||
cmd = &authd_cmd_tab[*parv[0]];
|
||||
cmd = &authd_cmd_tab[(unsigned char)*parv[0]];
|
||||
if(cmd->fn != NULL)
|
||||
{
|
||||
if(cmd->min_parc > parc)
|
||||
|
|
|
@ -731,7 +731,7 @@ conn_mod_read_cb(rb_fde_t *fd, void *data)
|
|||
|
||||
length = rb_read(fd, inbuf, sizeof(inbuf));
|
||||
|
||||
if (length < 0)
|
||||
if (length < 0)
|
||||
{
|
||||
if (rb_ignore_errno(errno))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue