Skip to content

Conversation

yutaro-sakamoto
Copy link
Contributor

This pull request introduces support for testing variable-length file handling in the COBOL runtime and ensures that record sizes do not exceed the configured maximum. The changes include a bug fix for record size assignment, updates to the test suite to add coverage for variable-length files, and the addition of a new test case.

Bug fix and runtime improvement:

  • Ensured that the record size set in CobolSequentialFile.java does not exceed the configured maximum (record_max), preventing buffer overruns when reading variable-length records.

Test suite enhancements:

  • Added misc.src/variable-length-file.at to the test dependencies in both tests/Makefile.am and tests/Makefile.in, ensuring the new test is included in the build and test process. [1] [2]
  • Included the new test in the test suite by updating tests/misc.at to m4-include variable-length-file.at.
  • Added a new test case file misc.src/variable-length-file.at that verifies reading from a variable-length file, including COBOL source, file content checks, and expected output validation.

@yutaro-sakamoto yutaro-sakamoto marked this pull request as ready for review September 19, 2025 06:10
@Copilot Copilot AI review requested due to automatic review settings September 19, 2025 06:10
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request fixes variable-length SEQUENTIAL file handling in the COBOL runtime and adds comprehensive test coverage. The primary purpose is to prevent buffer overruns when reading variable-length records by ensuring record sizes don't exceed configured maximums.

  • Fixed a critical bug in CobolSequentialFile.java where record sizes could exceed the maximum allowed size
  • Added a new test case to verify variable-length file reading functionality
  • Integrated the new test into the build system and test suite

Reviewed Changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/file/CobolSequentialFile.java Fixed record size assignment to prevent buffer overruns
tests/misc.src/variable-length-file.at Added new test case for variable-length file handling
tests/misc.at Included the new test in the test suite
tests/Makefile.am Added test dependency for build system
tests/Makefile.in Added test dependency for generated makefile

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@yutaro-sakamoto yutaro-sakamoto merged commit ae2469f into opensourcecobol:develop Sep 22, 2025
145 checks passed
@yutaro-sakamoto yutaro-sakamoto mentioned this pull request Sep 29, 2025
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