Skip to content

fix potential crash in search#4590

Merged
ABSitf merged 3 commits intomasterfrom
d20250523_fix_search_potential_crash
May 26, 2025
Merged

fix potential crash in search#4590
ABSitf merged 3 commits intomasterfrom
d20250523_fix_search_potential_crash

Conversation

@ABSitf
Copy link
Contributor

@ABSitf ABSitf commented May 23, 2025

No description provided.

continue;
auto dropItem = schema.items.find( dropRibItem->name() );
if ( dropItem == schema.items.end() )
if ( dropItem == schema.items.end() || !item->second.item )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same check as in 206 line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same logic, but for another object

Comment on lines +302 to +308
std::vector<SearchResult> res;
res.reserve( rawResult.size() );
if ( params.weights )
*params.weights = std::vector<SearchResultWeight>( rawResult.size() );
{
params.weights->clear();
params.weights->reserve( rawResult.size() );
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why reserve and not resize?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@ABSitf ABSitf merged commit 08bbc0a into master May 26, 2025
67 of 70 checks passed
@ABSitf ABSitf deleted the d20250523_fix_search_potential_crash branch May 26, 2025 00:56
MaxRayskiy pushed a commit that referenced this pull request Sep 27, 2025
* fix potential crash in search

* more fix

* fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants