diff --git a/programs/ssl/ssl_mail_client.c b/programs/ssl/ssl_mail_client.c index 90845bd4d..e355f2ea3 100644 --- a/programs/ssl/ssl_mail_client.c +++ b/programs/ssl/ssl_mail_client.c @@ -706,8 +706,13 @@ int main( int argc, char *argv[] ) fflush( stdout ); n = sizeof( buf ); - len = base64_encode( base, &n, (const unsigned char *) opt.user_name, + ret = base64_encode( base, &n, (const unsigned char *) opt.user_name, strlen( opt.user_name ) ); + + if( ret != 0 ) { + printf( " failed\n ! base64_encode returned %d\n\n", ret ); + goto exit; + } len = sprintf( (char *) buf, "%s\r\n", base ); ret = write_ssl_and_get_response( &ssl, buf, len ); if( ret < 300 || ret > 399 ) @@ -721,8 +726,13 @@ int main( int argc, char *argv[] ) printf( " > Write password to server: %s", opt.user_pwd ); fflush( stdout ); - len = base64_encode( base, &n, (const unsigned char *) opt.user_pwd, + ret = base64_encode( base, &n, (const unsigned char *) opt.user_pwd, strlen( opt.user_pwd ) ); + + if( ret != 0 ) { + printf( " failed\n ! base64_encode returned %d\n\n", ret ); + goto exit; + } len = sprintf( (char *) buf, "%s\r\n", base ); ret = write_ssl_and_get_response( &ssl, buf, len ); if( ret < 200 || ret > 399 )