Skip to content

Add assertion to clarify assumption made in order to avoid UB #953

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 8, 2018
Merged

Add assertion to clarify assumption made in order to avoid UB #953

merged 1 commit into from
Feb 8, 2018

Conversation

practicalswift
Copy link
Contributor

@practicalswift practicalswift commented Feb 8, 2018

Add assertion to clarify assumption made in order to avoid UB.

This assertion will help static (and human) analyzers identify the assumption made.

@ZmnSCPxj
Copy link
Contributor

ZmnSCPxj commented Feb 8, 2018

Duplicates the check at line 319?

@ZmnSCPxj
Copy link
Contributor

ZmnSCPxj commented Feb 8, 2018

Probably better to replace line 319 with that, actually.

-        assert(tal_len(route_channels) != 0);
+        assert(num_channels != 0);

@practicalswift
Copy link
Contributor Author

@ZmnSCPxj Thanks for reviewing. Replaced check. Please re-review :-)

@cdecker
Copy link
Member

cdecker commented Feb 8, 2018

Looks good to me

ACK 36331d2

@cdecker
Copy link
Member

cdecker commented Feb 8, 2018

No idea why travis didn't pick this PR up. But I'd say it's simple enough to just merge.

@cdecker cdecker merged commit 5474512 into ElementsProject:master Feb 8, 2018
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