Skip to content
Snippets Groups Projects
Commit c04a4ab9 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

algo: fix possible index out of bounds

parent 2eeb643f
No related branches found
No related tags found
1 merge request!191Fixing unintentional copying, possible index out of bounds; Enable compilation with g++-11
Checking pipeline status
......@@ -24,7 +24,9 @@ ext::vector<size_t> BorderArray::construct(const string::LinearString < SymbolTy
ext::vector<size_t> res(w.size() + 1);
 
res[0] = -1;
res[1] = 0;
if ( w.size ( ) > 0 )
res[1] = 0;
for(size_t i = 1; i < w.size(); i++) {
size_t b = res[i];
while (b > 0 && w[i] != w[b])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment