From c63cd21e6aa229c7fc0c855981c8e625931ad9de Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 25 Mar 2016 21:10:34 -0500 Subject: [PATCH] authd: check if handler is NULL, ensure that we do not overflow --- authd/authd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/authd/authd.c b/authd/authd.c index 81c4b340..8040406c 100644 --- a/authd/authd.c +++ b/authd/authd.c @@ -64,8 +64,11 @@ handle_reload(int parc, char *parv[]) if(parc < 2) { /* Reload all handlers */ - for(size_t i = 0; i < sizeof(authd_reload_handlers); handler = authd_reload_handlers[i++]) - handler(parv[1][0]); + for(size_t i = 0; i < sizeof(authd_reload_handlers); i++) + { + if ((handler = authd_reload_handlers[(unsigned char) i]) != NULL) + handler(parv[1][0]); + } return; }