From 8fbd9cdafedb42d8a2fd8f089d7a40f0d5f81aea Mon Sep 17 00:00:00 2001 From: Javad Date: Sun, 25 Sep 2022 15:31:49 +0400 Subject: [PATCH] Update ngx_http_auth_jwt_module.c --- src/ngx_http_auth_jwt_module.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/ngx_http_auth_jwt_module.c b/src/ngx_http_auth_jwt_module.c index f91e608..b881d4b 100644 --- a/src/ngx_http_auth_jwt_module.c +++ b/src/ngx_http_auth_jwt_module.c @@ -442,11 +442,18 @@ loadAuthKey(ngx_conf_t *cf, ngx_http_auth_jwt_loc_conf_t* conf) { } conf->_auth_jwt_keyfile.data = ngx_palloc(cf->pool, keySize); - fread(conf->_auth_jwt_keyfile.data, 1, keySize, keyFile); - conf->_auth_jwt_keyfile.len = (int)keySize; - fclose(keyFile); - return NGX_OK; + if(fread(conf->_auth_jwt_keyfile.data, 1, keySize, keyFile)) { + conf->_auth_jwt_keyfile.len = (int)keySize; + fclose(keyFile); + return NGX_OK; + + } else { + + return NGX_ERROR; + + } + } static char *