Skip to content

Commit 62f6785

Browse files
committed
Fix crash when URI is invalid
1 parent 2e1a4d5 commit 62f6785

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

driver/mysql_connection.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,9 @@ void MySQL_Connection::init(ConnectOptionsMap & properties)
582582
Parsing uri prior to processing all parameters, so indivudually
583583
specified parameters precede over those in the uri
584584
*/
585-
parseUri(*p_s, uri);
585+
if(!parseUri(*p_s, uri))
586+
throw sql::InvalidArgumentException("Invalid hostname URI");
587+
586588
} else {
587589
throw sql::InvalidArgumentException("No string value passed for hostName");
588590
}

0 commit comments

Comments
 (0)