Skip to content

Add assertions to clarify our assumptions about msg != NULL #1032

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

Merged
merged 1 commit into from
Feb 19, 2018
Merged

Add assertions to clarify our assumptions about msg != NULL #1032

merged 1 commit into from
Feb 19, 2018

Conversation

practicalswift
Copy link
Contributor

Avoid using uninitialized values when calling command_fail_detailed(...).

Copy link
Contributor

@ZmnSCPxj ZmnSCPxj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All possible values of r->errorcode are handled in both switch statements, and all switch cases load some value to data and msg.

Also, a NULL data is allowed by command_fail_detailed: this is for the case where the error has no data it can return. For PAY_IN_PROGRESS and PAY_RHASH_ALREADY_USED for example.

Maybe an assert(msg) would be sufficient.

@practicalswift practicalswift changed the title Avoid using uninitialized values when calling command_fail_detailed(...) Add assertions to clarify our assumptions about msg != NULL Feb 19, 2018
@practicalswift
Copy link
Contributor Author

@ZmnSCPxj Thanks for your quick clarification. Updated accordingly. Please review :-)

@ZmnSCPxj
Copy link
Contributor

ACK ad3a1ee

@practicalswift
Copy link
Contributor Author

practicalswift commented Feb 19, 2018

@ZmnSCPxj Sorry was a bit too quick. Would you mind re-reviewing? :-)

@ZmnSCPxj
Copy link
Contributor

ACK 4a9e26c

@cdecker
Copy link
Member

cdecker commented Feb 19, 2018

Thanks @practicalswift for the PR and thanks @ZmnSCPxj for the super fast review round :-)

@cdecker cdecker merged commit f351417 into ElementsProject:master Feb 19, 2018
rustyrussell added a commit to rustyrussell/lightning that referenced this pull request Apr 1, 2023
"Allow nodes to overshoot final htlc amount and expiry (ElementsProject#1032)"

Note that this also renamed `min_final_cltv_expiry` to the more-correct
`min_final_cltv_expiry_delta`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
rustyrussell added a commit to rustyrussell/lightning that referenced this pull request Apr 7, 2023
"Allow nodes to overshoot final htlc amount and expiry (ElementsProject#1032)"

Note that this also renamed `min_final_cltv_expiry` to the more-correct
`min_final_cltv_expiry_delta`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
rustyrussell added a commit that referenced this pull request Apr 7, 2023
"Allow nodes to overshoot final htlc amount and expiry (#1032)"

Note that this also renamed `min_final_cltv_expiry` to the more-correct
`min_final_cltv_expiry_delta`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
itme-brain pushed a commit to itme-brain/lightning that referenced this pull request Apr 7, 2023
"Allow nodes to overshoot final htlc amount and expiry (ElementsProject#1032)"

Note that this also renamed `min_final_cltv_expiry` to the more-correct
`min_final_cltv_expiry_delta`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ddustin pushed a commit to ddustin/lightning that referenced this pull request Apr 11, 2023
"Allow nodes to overshoot final htlc amount and expiry (ElementsProject#1032)"

Note that this also renamed `min_final_cltv_expiry` to the more-correct
`min_final_cltv_expiry_delta`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
gkrizek pushed a commit to voltagecloud/lightning that referenced this pull request Apr 26, 2023
"Allow nodes to overshoot final htlc amount and expiry (ElementsProject#1032)"

Note that this also renamed `min_final_cltv_expiry` to the more-correct
`min_final_cltv_expiry_delta`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ddustin pushed a commit to ddustin/lightning that referenced this pull request May 12, 2023
"Allow nodes to overshoot final htlc amount and expiry (ElementsProject#1032)"

Note that this also renamed `min_final_cltv_expiry` to the more-correct
`min_final_cltv_expiry_delta`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
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

Successfully merging this pull request may close these issues.

3 participants