Skip to content

Commit 8fbd9cd

Browse files
authored
Update ngx_http_auth_jwt_module.c
1 parent 8f39e48 commit 8fbd9cd

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/ngx_http_auth_jwt_module.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,11 +442,18 @@ loadAuthKey(ngx_conf_t *cf, ngx_http_auth_jwt_loc_conf_t* conf) {
442442
}
443443

444444
conf->_auth_jwt_keyfile.data = ngx_palloc(cf->pool, keySize);
445-
fread(conf->_auth_jwt_keyfile.data, 1, keySize, keyFile);
446-
conf->_auth_jwt_keyfile.len = (int)keySize;
447445

448-
fclose(keyFile);
449-
return NGX_OK;
446+
if(fread(conf->_auth_jwt_keyfile.data, 1, keySize, keyFile)) {
447+
conf->_auth_jwt_keyfile.len = (int)keySize;
448+
fclose(keyFile);
449+
return NGX_OK;
450+
451+
} else {
452+
453+
return NGX_ERROR;
454+
455+
}
456+
450457
}
451458

452459
static char *

0 commit comments

Comments
 (0)