Cobol compiler fixes use-after-free and improves ADD CORRESPONDING.
Cobol compiler corrects a use-after-free error and improves operand validation for ADD CORRESPONDING.
The Cobol compiler has been updated to fix a use-after-free error by ensuring that the arith_t structure is constructed by value and that reference lists are initialized rather than copied. Additionally, the compiler now validates that the ADD CORRESPONDING statement accepts exactly two operands, addressing a known issue and preventing an internal compiler error (ICE) for WRITE statements in syntax-only mode.
In Details
The cobol front-end's parser component has been refined. Changes to parse.y and parse_ante.h address a use-after-free by ensuring value construction of arith_t and prefering direct initialization for refer_list_t. Additionally, parse.y now includes validation for the operand count of ADD CORRESPONDING, mitigating RT 3665, and genapi.cc prevents an ICE in parser_file_write by using RETURN_IF_PARSE_ONLY.
- use-after-free
- A memory corruption vulnerability where a program continues to use a pointer after the memory it points to has been freed or deallocated. This can lead to crashes or security exploits.
- ADD CORRESPONDING
- A COBOL statement used to add corresponding data items between two group items. It operates on data items that have the same name within the group structures.
- ICE (Internal Compiler Error)
- An unexpected error that occurs within the compiler itself, halting the compilation process. These are typically bugs in the compiler that need to be fixed by the developers.
- syntax-only mode
- A compiler mode where the compiler only checks for syntactical correctness of the code without performing any actual code generation or optimization.