- Fixed crash in tls_read (unchecked null pointer)

- also check for empty string on username and password to launch authentication callback
This commit is contained in:
Benoît LeBlanc 2013-10-18 16:23:29 -04:00
parent 970d8d2260
commit 801c1fe1d6
2 changed files with 4 additions and 3 deletions

View File

@ -119,7 +119,8 @@ int credssp_ntlm_client_init(rdpCredssp* credssp)
settings = credssp->settings;
instance = (freerdp*) settings->instance;
if ((settings->Password == NULL) || (settings->Username == NULL))
if ((settings->Password == NULL ) || (settings->Username == NULL)
|| (!strlen(settings->Password)) || (!strlen(settings->Username)))
{
if (instance->Authenticate)
{

View File

@ -373,9 +373,9 @@ int tls_read(rdpTls* tls, BYTE* data, int length)
int error;
int status;
status = SSL_read(tls->ssl, data, length);
status = tls ? SSL_read(tls->ssl, data, length) : -1;
if (status <= 0)
if (tls && status <= 0)
{
error = SSL_get_error(tls->ssl, status);