Fix unchecked error on windows

This commit is contained in:
Manuel Pégourié-Gonnard 2015-02-05 11:34:49 +00:00
parent e12abf90ce
commit 2dc15c8e7d
2 changed files with 7 additions and 2 deletions

View file

@ -20,9 +20,10 @@ Bugfix
* Fix memory leaks in PKCS#5 and PKCS#12.
* Stack buffer overflow if ctr_drbg_update() is called with too large
add_len (found by Jean-Philippe Aumasson) (not triggerable remotely).
* Fix bug in MPI/bugnum on s390/s390x (reported by Dan Horák) (introduced
* Fix bug in MPI/bignum on s390/s390x (reported by Dan Horák) (introduced
in 1.2.12).
* Fix unchecked return code in x509_crt_parse_path() on Windows (found by
Peter Vaskovic).
Changes
* Blind RSA private operations even when POLARSSL_RSA_NO_CRT is defined.

View file

@ -1949,6 +1949,8 @@ int x509parse_crtpath( x509_cert *chain, const char *path )
filename[len++] = '*';
w_ret = MultiByteToWideChar( CP_ACP, 0, filename, len, szDir, MAX_PATH - 3 );
if( w_ret == 0 )
return( POLARSSL_ERR_X509_INVALID_INPUT );
hFind = FindFirstFileW( szDir, &file_data );
if (hFind == INVALID_HANDLE_VALUE)
@ -1966,6 +1968,8 @@ int x509parse_crtpath( x509_cert *chain, const char *path )
lstrlenW(file_data.cFileName),
p, len - 1,
NULL, NULL );
if( w_ret == 0 )
return( POLARSSL_ERR_X509_FILE_IO_ERROR );
w_ret = x509parse_crtfile( chain, filename );
if( w_ret < 0 )