Skip to content

Commit 4e64e16

Browse files
authored
Update ngx_http_auth_jwt_module.c
1 parent 1653ef1 commit 4e64e16

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ngx_http_auth_jwt_module.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,10 @@ loadAuthKey(ngx_conf_t *cf, ngx_http_auth_jwt_loc_conf_t* conf) {
435435
}
436436

437437
conf->_auth_jwt_keyfile.data = ngx_palloc(cf->pool, keySize);
438-
fread(conf->_auth_jwt_keyfile.data, 1, keySize, keyFile);
438+
if(fread(conf->_auth_jwt_keyfile.data, 1, keySize, keyFile) != keySize) {
439+
ngx_log_error(NGX_LOG_ERR, cf->log, 0, "error reading key file, check the key file");
440+
return NGX_ERROR;
441+
}
439442
conf->_auth_jwt_keyfile.len = (int)keySize;
440443

441444
fclose(keyFile);

0 commit comments

Comments
 (0)