Commit 73e010f1 authored by Adam Wujek's avatar Adam Wujek 💬

userspace/tools: prevent segfaults in dump_shmem when pointer is not valid

dump_many_fields shall check if pointer to dump is valid. It is simpler than
checking if all wrs_shm_follow were successful.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 43fb7aa5
......@@ -171,6 +171,10 @@ void dump_many_fields(void *addr, struct dump_info *info, int ninfo)
{
int i;
if (!addr) {
fprintf(stderr, "dump: pointer not valid\n");
return;
}
for (i = 0; i < ninfo; i++)
dump_one_field(addr, info + i);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment