Fix undefined behaviour in Session::session_name_is_legal

The for loop was checking out of bound indicies causing some perfectly
legal session names to be identified as illegal
This commit is contained in:
Nikolaus Gullotta
2020-06-23 13:33:14 -05:00
parent 32aa290578
commit cf0f1fd6c3

View File

@@ -6765,7 +6765,7 @@ Session::session_name_is_legal (const string& path)
{
char illegal_chars[] = { '/', '\\', ':', ';' };
for (int i = 0; illegal_chars[i]; ++i) {
for (int i = 0; i < 4; ++i) {
if (path.find (illegal_chars[i]) != string::npos) {
return std::string (1, illegal_chars[i]);
}