Skip to content

Commit

Permalink
Ensure that we read the entire memory map from procfs
Browse files Browse the repository at this point in the history
  • Loading branch information
descawed committed Oct 11, 2024
1 parent 9dbe92d commit 3eb1f5d
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,16 @@ namespace hex::plugin::builtin {
if (!file.isValid())
return;

for (const auto &line : wolv::util::splitString(file.readString(), "\n")) {
// procfs files don't have a defined size, so we have to just keep reading until we stop getting data
std::string data;
while (true) {
auto chunk = file.readString(0xFFFF);
if (chunk.empty())
break;
data.append(chunk);
}

for (const auto &line : wolv::util::splitString(data, "\n")) {
const auto &split = splitString(line, " ");
if (split.size() < 5)
continue;
Expand Down

0 comments on commit 3eb1f5d

Please sign in to comment.