Skip to content

Address scan-build warning of tmp->tm_mon again #1206

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 15, 2023

Conversation

eramongodb
Copy link
Contributor

Followup to #1178 and #1201. Upon further inspection, it seems like the analyzer fails to realize the subscripts of ip is indexing the array elements of mon_lengths (length of MONSPERYEAR), mistakening the length of the array pointed to by ip to be 2 (length of mon_lengths instead of mon_lengths[n]). To aid scan-build in its analysis, propose changing the type of ip to be explicitly a pointer to arrays of length MONSPERYEAR.

@eramongodb eramongodb requested a review from kevinAlbs February 14, 2023 22:17
@eramongodb eramongodb self-assigned this Feb 14, 2023
@eramongodb eramongodb merged commit 79627c2 into mongodb:master Feb 15, 2023
@eramongodb eramongodb deleted the cdriver-scan-build branch February 15, 2023 21:57
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