← Back to team overview

linuxdcpp-team team mailing list archive

[Bug 1215338] Re: for-loop iteration may cause crash

 

no, this is fine: searchResults is an std::list so its values are not
invalidated on inserts.

see the comment at line win32/SearchFrame.h:189:
	list<SearchInfo> searchResults; /* the LPARAM data of table entries are direct pointers to
									objects stored by this container, hence the std::list. */

how have you landed up on this? were you investigating a crash?

-- 
You received this bug notification because you are a member of
Dcplusplus-team, which is subscribed to DC++.
https://bugs.launchpad.net/bugs/1215338

Title:
  for-loop iteration may cause crash

Status in DC++:
  New

Bug description:
  SearchFrame.cpp, method void SearchFrame::addResult(SearchResultPtr
  psr), when you iterate through searchResults (for(auto& si2:
  searchResults) {), emplace_back on searchResults invalidates auto&
  si2, so                             si2.srs.push_back(psr); may cause
  crash

To manage notifications about this bug go to:
https://bugs.launchpad.net/dcplusplus/+bug/1215338/+subscriptions


References