Skip to content

Fix issue #309 - Advance offset by string table field size #310

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

Merged
merged 3 commits into from Jun 5, 2022
Merged

Fix issue #309 - Advance offset by string table field size #310

merged 3 commits into from Jun 5, 2022

Conversation

ghost
Copy link

@ghost ghost commented May 27, 2022

Fixes issue #309

There's a bug in master where the code ends up misreading the symbol table because we don't advance the offset prior to reading the strings.

This change fixes the issue by adding the correct value to the offset and also includes a unit test that covers this case.

There's a bug in master where the code ends up misreading the symbol table because we don't advance the offset prior to reading the strings.

This change fixes the issue by adding the correct value to the offset and also includes a unit test that covers this case.
Copy link
Owner

@m4b m4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great thank you! I think this is a longstanding bug/irritation you've fixed, much appreciated!

@m4b
Copy link
Owner

m4b commented May 28, 2022

@track-5 looks like it needs a rustfmt; you can also add #[rustfmt::skip] to that test block of bytes, since it doesn't need to be formatted.

@ghost
Copy link
Author

ghost commented May 29, 2022

@m4b my bad! Just ran cargo fmt and pushed the new commit :)

@m4b
Copy link
Owner

m4b commented May 30, 2022

Looks like you need to use core instead of size for sizeof

@ghost
Copy link
Author

ghost commented May 31, 2022

Done. Ran the cargo build command locally to be sure it works now:

P:\goblin>cargo build --no-default-features --features="pe32"
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s

@m4b m4b merged commit 66728bb into m4b:master Jun 5, 2022
@m4b
Copy link
Owner

m4b commented Jun 6, 2022

ok released in 0.5.2, thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant