Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Added pointer checks to RelativeData list fetching avoid accessing fa…
Browse files Browse the repository at this point in the history
…ulty addresses (lib)
  • Loading branch information
IndrekV committed Feb 9, 2018
1 parent 4dcefec commit 577a2c6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/related_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,9 @@ void RelatedData::workspaceAutocompleteItems(
void RelatedData::TagList(
std::vector<std::string> *tags,
const Poco::UInt64 wid) const {

poco_check_ptr(tags);

std::set<std::string> unique_names;

for (std::vector<Tag *>::const_iterator it =
Expand All @@ -485,6 +488,9 @@ void RelatedData::TagList(
}

void RelatedData::WorkspaceList(std::vector<Workspace *> *result) const {

poco_check_ptr(result);

for (std::vector<Workspace *>::const_iterator it =
Workspaces.begin();
it != Workspaces.end();
Expand All @@ -499,6 +505,8 @@ void RelatedData::WorkspaceList(std::vector<Workspace *> *result) const {
}

void RelatedData::ClientList(std::vector<Client *> *result) const {

poco_check_ptr(result);
*result = Clients;

std::sort(result->rbegin(), result->rend(), CompareClientByName);
Expand Down

0 comments on commit 577a2c6

Please sign in to comment.