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
Should strtab parsing jump over contigous blocks of \0
#384
Comments
\0
\0
Yes. Values in the strtab only have meaning if something references them.
Be aware that a string and its suffixes can be referenced from multiple places, so by modifying the string for rpath it is possible to be changing another string at the same time. This may be unlikely for the complete rpath string, but it's hard to tell when the suffix will have meaning somewhere else too.
If something actually references the \0, then the parser should return an empty string. If the parser jumped over it, then I think As an aside, the way that goblin parses string tables into a list of strings is unusual. Most parsers don't do that. |
Hi @philipc thanks for your insights! Am I correct in the assumption that the strings for rpath are in the |
Yes the rpath reference is in |
I am wondering if adding additional
\0
in thestrtab
is valid (we want to override therpath
of a shared library by replacing the string with a shorter,\0
padded one).I looked at the code for strtab parsing I noticed that it creates empty strings if it finds multiple consecutive
\0
, e.g. this test fails:with
Wouldn't it be more expected that the parser jumps over blocks of
\0
? I am expecting the parsing with offsets to work as expected.The text was updated successfully, but these errors were encountered: