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

Check string is nonempty before indexing #1239

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

WardBrian
Copy link
Member

Submisison Checklist

  • Run tests: ./runCmdStanTests.py src/test
  • Declare copyright holder and open-source license: see below

Summary:

Resolves #1238. An unchecked indexing operation on an empty string introduced by #1228 causes a crash if compiled with -Wp,-D_GLIBCXX_ASSERTIONS, and possibly under other conditions

Intended Effect:

Resolves the crash

How to Verify:

Side Effects:

Documentation:

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

@WardBrian
Copy link
Member Author

@serban-nicusor-toptal is there an easy way to set -Wp,-D_GLIBCXX_ASSERTIONS in our CI? Seems like it would catch things like this earlier.

@serban-nicusor-toptal
Copy link
Contributor

I think the easiest way is to add that at the end of writeFile here https://github.com/stan-dev/cmdstan/blob/develop/Jenkinsfile#L11

@WardBrian WardBrian mentioned this pull request Jan 17, 2024
2 tasks
@WardBrian WardBrian merged commit 935f271 into develop Jan 17, 2024
1 check passed
@WardBrian WardBrian deleted the fix/1238-string-index-out-of-bounds branch January 17, 2024 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bernoulli example fails to run on latest release
3 participants