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

s_evalAutomorphismKeyMap gets an extra index of zero due to vector initialization #783

Closed
evmanz opened this issue May 29, 2024 · 0 comments · Fixed by #787
Closed

s_evalAutomorphismKeyMap gets an extra index of zero due to vector initialization #783

evmanz opened this issue May 29, 2024 · 0 comments · Fixed by #787
Assignees
Labels
bug Something isn't working
Milestone

Comments

@evmanz
Copy link

evmanz commented May 29, 2024

The GetExistingEvalAutomorphismKeyIndices(...) method in src/pke/lib/cryptocontext.cpp adds extra index with value of zero to the vector of key indices from the KeyMap.

It happens because the vector first is set to specific size with all values set to default value of 0:

std::vector<uint32_t> indices(keyMap.size());
and then existing indices in the map are push_back(...)'ed to it.

As a result, the vector of indices has 0s inside which are not present in the original map, and thus have no actual key behind them (an empty PolyImpl is created later).

As a result, there is a segfault due to a null pointer dereference in CompressEvalKeys(...) function in demo-logistic.cpp: CompressEvalKeys(...).

@yspolyakov yspolyakov added the bug Something isn't working label May 30, 2024
@yspolyakov yspolyakov added this to the Release 1.2.0 milestone May 30, 2024
@dsuponitskiy dsuponitskiy linked a pull request May 31, 2024 that will close this issue
@pascoec pascoec closed this as completed May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants