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

Prevent string out of bounds. #46

Merged
merged 3 commits into from
Jul 26, 2024
Merged

Conversation

DJDavies2
Copy link
Contributor

Resolves #45. It seems that the code has hardcoded string limits and at some point the strings being passed to fckit are too long for the hardcoded limit. I don't know where those are coming from, but I think it would be better if the string truncated in that case rather than went out of bounds and did undefined behaviour.

I have done this by turning the dummy argument into an assumed shape array which means its bounds are passed in the subroutine call. The loop can then have an upper bound which ensures that the array never goes out of bounds. What do you think?

@wdeconinck wdeconinck added the approved-for-ci Approved for CI run label Jul 10, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (develop@df7f157). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop      #46   +/-   ##
==========================================
  Coverage           ?   51.17%           
==========================================
  Files              ?       58           
  Lines              ?     4782           
  Branches           ?      449           
==========================================
  Hits               ?     2447           
  Misses             ?     2335           
  Partials           ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot removed the approved-for-ci Approved for CI run label Jul 14, 2024
@DJDavies2
Copy link
Contributor Author

I've done another update; I had a failure in saber where there was an attempt to pass a yaml configuration through the routines that had more that 255 characters in total.

@wdeconinck wdeconinck added the approved-for-ci Approved for CI run label Jul 26, 2024
@wdeconinck wdeconinck merged commit 4d812b9 into ecmwf:develop Jul 26, 2024
94 checks passed
@wdeconinck
Copy link
Member

Thanks @DJDavies2 !!!

wdeconinck added a commit that referenced this pull request Sep 19, 2024
* hotfix/0.13.1:
  Version 0.13.1
  FCKIT_VENV: enable editable installation of python packages
  Prevent macros starting with '__' to be added to fypp
  Prevent string out of bounds. (#46)
  Fixes for NAG compiler (#43)
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.

Failure in atlas_fctest_trace
3 participants