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

Exceeding array bounds in SGVector::arg_max(vec, inc, len, ptr), SGVector.cpp, Line 995 #1164

Closed
tklein23 opened this issue Jun 7, 2013 · 4 comments

Comments

@tklein23
Copy link
Contributor

tklein23 commented Jun 7, 2013

Simply add an assertion to enforce array bounds to the loop:

ASSERT(j < len)

This should never happen, but will break two unit tests.

@tklein23
Copy link
Contributor Author

tklein23 commented Jun 7, 2013

Failing tests are: mMCLDA.train_and_apply and mQDA.train_and_apply

@karlnapf
Copy link
Member

karlnapf commented Jun 8, 2013

Thanks for reporting! Ouch! We should probably just rewrite this method in a proper (and in fact readable) way

@tklein23
Copy link
Contributor Author

Soeren told, that this method is correct. So the only issue is documentation and/or readability.

My assumption was (j < len), but as far as I see, this was wrong.

@karlnapf
Copy link
Member

@sonney2k Could you document this method?

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

2 participants