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

Coverity 1515953: negative loop bound #19413

Closed
wants to merge 1 commit into from

Conversation

paulidale
Copy link
Contributor

No description provided.

@paulidale paulidale added branch: master Merge to master branch approval: review pending This pull request needs review by a committer approval: otc review pending This pull request needs review by an OTC member triaged: bug The issue/pr is/fixes a bug labels Oct 14, 2022
@paulidale paulidale self-assigned this Oct 14, 2022
@slontis
Copy link
Member

slontis commented Oct 14, 2022

You beat me to it.. it should not hit this in practice but it is better this way.

Copy link
Member

@slontis slontis left a comment

Choose a reason for hiding this comment

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

I need to beat it into my head that sk_num() can return -1..
Whether it should or not is a different matter.

@paulidale
Copy link
Contributor Author

Sadly, it can return -1 and is documented as doing so. It's idiotic IMO. sk_num(NULL) ought to return 0 since there are no elements.

@paulidale paulidale removed the approval: otc review pending This pull request needs review by an OTC member label Oct 14, 2022
@t8m t8m added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels Oct 14, 2022
@tom-cosgrove-arm
Copy link
Contributor

How about adding a new API OPENSSL_sk_count() where sk_count(NULL) -> 0, else sk_count(s) -> sk_num(s) ?

@paulidale
Copy link
Contributor Author

Adding APIs is essentially a permanent commitment to maintaining them. OpenSSL has a very conservative policy about API changes. While I like the suggestion, I'm not sure the ongoing support is worth the pain.

@openssl-machine
Copy link
Collaborator

24 hours has passed since 'approval: done' was set, but as this PR has been updated in that time the label 'approval: ready to merge' is not being automatically set. Please review the updates and set the label manually.

@paulidale
Copy link
Contributor Author

Merged.

@paulidale paulidale closed this Oct 16, 2022
@paulidale paulidale deleted the coverity20221014 branch October 16, 2022 22:46
openssl-machine pushed a commit that referenced this pull request Oct 16, 2022
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from #19413)
t8m pushed a commit to t8m/openssl that referenced this pull request Nov 21, 2022
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from openssl#19413)

(cherry picked from commit 9ab57f2)
openssl-machine pushed a commit that referenced this pull request Nov 23, 2022
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from #19413)

(cherry picked from commit 9ab57f2)
beldmit pushed a commit to beldmit/openssl that referenced this pull request Dec 26, 2022
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from openssl#19413)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval: done This pull request has the required number of approvals branch: master Merge to master branch triaged: bug The issue/pr is/fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants