File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -54,20 +54,21 @@ class uri {
54
54
int state = 0 ;
55
55
56
56
it = uri_string.begin ();
57
+ size_t uri_len = uri_string.length ();
57
58
58
- if (std::equal (it,it+6 ," wss://" )) {
59
+ if (uri_len >= 7 && std::equal (it,it+6 ," wss://" )) {
59
60
m_secure = true ;
60
61
m_scheme = " wss" ;
61
62
it += 6 ;
62
- } else if (std::equal (it,it+5 ," ws://" )) {
63
+ } else if (uri_len >= 6 && std::equal (it,it+5 ," ws://" )) {
63
64
m_secure = false ;
64
65
m_scheme = " ws" ;
65
66
it += 5 ;
66
- } else if (std::equal (it,it+7 ," http://" )) {
67
+ } else if (uri_len >= 8 && std::equal (it,it+7 ," http://" )) {
67
68
m_secure = false ;
68
69
m_scheme = " http" ;
69
70
it += 7 ;
70
- } else if (std::equal (it,it+8 ," https://" )) {
71
+ } else if (uri_len >= 9 && std::equal (it,it+8 ," https://" )) {
71
72
m_secure = true ;
72
73
m_scheme = " https" ;
73
74
it += 8 ;
You can’t perform that action at this time.
0 commit comments