-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(pdb): skip reading rows of invalid pages #93
Conversation
as per doc of `pdb::Page::page_flags` certain pages contain garbage data and thus should not try to read rowdata. fixes Holzhaus#72
This solution just skips the rows but still reads the page (which then contains no rows). Alternatively one could check if the page has no data and then not add it to vector of pages. That solution would be a little more complicated though I fear. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, good catch!
#[derive(Debug, PartialEq, Eq, Clone, Copy)] | ||
struct PageFlags(u8); | ||
|
||
impl PageFlags { | ||
#[must_use] | ||
pub fn page_has_data(&self) -> bool { | ||
(self.0 & 0x40) == 0 | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have a dependency on the modular_bitfield
crate, might make sense to use that instead:
#[bitfield]
pub struct PageFlags {
unknown1: B1,
no_data: bool,
unknown2: B6,
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know that, sure. I just don't know when I'll get around to it.
Couldn't get |
Hmm, I think we are using it because it was suggested by the If you restore the original PR, I can merge it now to fix the bug and we just put further improvements on the TODO list a.k.a. the issue tracker. |
9c17ff2
to
32bc3ff
Compare
restored |
Thanks |
Thanks for fixing. |
as per doc of
pdb::Page::page_flags
certainpages contain garbage data and thus should
not try to read rowdata.
fixes #72