mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-18 04:44:17 -05:00
ITS#7291 MozNSS: read pin from file file can cause infinite loop
The buffer allocated for reading password file has to be initialized with zeros, or we need to append zero at the end of the file. Otherwise we might read unitialized memory and consider it to be a password.
This commit is contained in:
parent
4b6bd2c600
commit
00d0e16272
1 changed files with 1 additions and 1 deletions
|
|
@ -786,7 +786,7 @@ tlsm_get_pin_from_file(const char *token_name, tlsm_ctx *ctx)
|
|||
}
|
||||
|
||||
/* create a buffer to hold the file contents */
|
||||
if ( !( contents = PR_MALLOC( file_info.size + 1 ) ) ) {
|
||||
if ( !( contents = PR_CALLOC( file_info.size + 1 ) ) ) {
|
||||
PRErrorCode errcode = PR_GetError();
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"TLS: could not alloc a buffer for contents of pin file %s - error %d:%s.\n",
|
||||
|
|
|
|||
Loading…
Reference in a new issue