Skip to content
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

tlsh/tlsh.h has faulty definition of TLSH_STRING_BUFFER_LEN #114

Open
mapreri opened this issue Oct 15, 2021 · 0 comments
Open

tlsh/tlsh.h has faulty definition of TLSH_STRING_BUFFER_LEN #114

mapreri opened this issue Oct 15, 2021 · 0 comments

Comments

@mapreri
Copy link
Contributor

mapreri commented Oct 15, 2021

Look at this trivial bit:

mattia@warren /tmp/foo1 % cat test.cxx
#include<tlsh/tlsh.h>

int main(){
    return TLSH_STRING_BUFFER_LEN;
}
mattia@warren /tmp/foo1 % c++ -Wall -Werror test.cxx -ltlsh  
In file included from test.cxx:1:
test.cxx: In function ‘int main()’:
test.cxx:4:12: error: ‘TLSH_STRING_LEN_REQ’ was not declared in this scope; did you mean ‘TLSH_STRING_BUFFER_LEN’?
    4 |     return TLSH_STRING_BUFFER_LEN;
      |            ^~~~~~~~~~~~~~~~~~~~~~
1 mattia@warren /tmp/foo1 %

that's because tlsh.h defines TLSH_STRING_BUFFER_LEN using TLSH_STRING_LEN_REQ as base, but this is not defined outside of the current tlsh build, since defining that relies on the presence of any of BUCKETS_(48|64|128) that during the build is done from cmake.

This is since 4.0.0 (commit dc3f047), when you changed the definition of TLSH_STRING_LEN_REQ to not have an else branch anymore.

What's supposed to happen now? Should "includers" of the library define BUCKETS_* somehow?

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

No branches or pull requests

1 participant