authd: Avoid negative array indices

This commit is contained in:
staticfox 2016-04-22 23:06:42 -04:00
parent 7445ece1d1
commit 1729f46eab
No known key found for this signature in database
GPG key ID: 12E27B3B33FF66A8
3 changed files with 4 additions and 4 deletions

View file

@ -136,7 +136,7 @@ load_provider(struct auth_provider *provider)
} }
if(provider->stats_handler.letter != '\0') 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) if(provider->init != NULL)
provider->init(); provider->init();
@ -156,7 +156,7 @@ unload_provider(struct auth_provider *provider)
} }
if(provider->stats_handler.letter != '\0') 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) if(provider->destroy != NULL)
provider->destroy(); provider->destroy();

View file

@ -284,7 +284,7 @@ parse_authd_reply(rb_helper * helper)
struct authd_cb *cmd; struct authd_cb *cmd;
parc = rb_string_to_array(buf, parv, MAXPARA+1); 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->fn != NULL)
{ {
if(cmd->min_parc > parc) if(cmd->min_parc > parc)

View file

@ -731,7 +731,7 @@ conn_mod_read_cb(rb_fde_t *fd, void *data)
length = rb_read(fd, inbuf, sizeof(inbuf)); length = rb_read(fd, inbuf, sizeof(inbuf));
if (length < 0) if (length < 0)
{ {
if (rb_ignore_errno(errno)) if (rb_ignore_errno(errno))
{ {