-
Notifications
You must be signed in to change notification settings - Fork 374
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
Fix out of bound access on pp_pop_psc_delta
and pulsepacket_generator
#2159
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f64c177
Fix out of bound access on pp_pop_psc_delta and pulsepacket_generator
niltonlk b4d1ae0
Replace || with or, and && with and, following comments by @heplesser
niltonlk 7d8bd63
Fix last spike was not sent due to error in conditional expression.
niltonlk 31a8b99
Add a comment: Set all except last state vector elements to zero, the…
niltonlk 10f3651
Add deprecation message.
niltonlk 205e7c2
Fix formatting
niltonlk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a very brutal fix. I looked some more at the pp_pop_psc_delta code and noticed (a) that the code is in poor shape and (b) that it has carried since Nov 2016 a deprecation notice referring users to gif_pop_psc_exp. I would therefore suggest to remove the model entirely. @jougs @terhorstd What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to remove the model in 3.2 and add a corresponding sentence to the detailed release notes of 3.1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify: please add the deprecation info for the model to the release notes in this PR, and open a new issue with the 3.2 milestone set about the removal of the model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @jougs. After some more code-staring, I now also understand why the
-1
is correct above. Even though we will remove the model in 3.2, could you add a comment above like# Set all except last element to zero.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taking a look at the code in gif_pop_psc_exp, another way to fix out of bound access here would be:
I just don't know what would be the best comment for this code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the code is soon disappearing, I'd keep changes minimal, so your
-1
solution is fine. Just put this comment before the loop:# Set all except last state vector elements to zero, then fill last element with initial value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.