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

mailbox_get_xconvemodseq() is never called with NULL for *modseqp #4621

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dilyanpalauzov
Copy link
Contributor

The way the function was written implied that the parameter modseqp could be NULL. If it were NULL, then “*modseqp = status.threadmodseq;” would cause NULL-dereference.

In practice the function is never called with NULL as last parameter.

This silences a warning from the Clang Static Analyzer.

The way the function was written implied that the parameter modseqp could be NULL.
If it were NULL, then “*modseqp = status.threadmodseq;” would cause NULL-dereference.

In practice the function is never called with NULL as last parameter.
@dilyanpalauzov dilyanpalauzov force-pushed the mailbox_get_xconvemodseq_modseq_nonnull branch from 9260f0a to 1755d89 Compare August 26, 2023 10:17
@@ -4387,9 +4387,6 @@ EXPORTED int mailbox_get_xconvmodseq(struct mailbox *mailbox, modseq_t *modseqp)
conv_status_t status = CONV_STATUS_INIT;
int r;

if (modseqp)
Copy link
Member

Choose a reason for hiding this comment

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

We should just remove the test here, or put an assert(modseqp)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This changeset removes the test.

@ksmurchison ksmurchison requested a review from brong January 5, 2024 17:41
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.

2 participants