Skip to content

Commit 746ae90

Browse files
committed
Fix hostName parser when no port is specified
1 parent fe90ae0 commit 746ae90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

driver/mysql_uri.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,11 @@ bool parseUri(const sql::SQLString & str, MySQL_Uri& uri)
245245
}
246246
else
247247
{
248-
name = host.substr(0, sep);
248+
name = host.substr(0, sep);
249249
}
250250
}
251251

252-
if(host[sep] == ':')
252+
if(sep < host.size() && host[sep] == ':')
253253
{
254254
//port
255255
host = host.substr(sep+1);

0 commit comments

Comments
 (0)