bug-gnucobol
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-GnuCOBOL] [GnuCOBOL 3.0-rc1] testsuite: 655 failed, 787 passed unex


From: TAG
Subject: [Bug-GnuCOBOL] [GnuCOBOL 3.0-rc1] testsuite: 655 failed, 787 passed unexpectedly
Date: Tue, 1 Jan 2019 12:14:18 -0700

gnu-COBOL 3.0-rc1 test  suite  item 655 fail.


traced problem in test 655 to the memset commands that are produced for the 
report writer RD section, the numbers produced for the memset parameters cause 
buffer overflow. if a filler is added to increase the line to 132 characters, 
the computed max line value only increases baby 5 from 108 to 113 instead of 
132.

I looks like the number used for the memset to blank to the end of the line in 
the report heading line is not computed correctly by the C code generator:

the report writer code in test 655

       01  TYPE IS REPORT HEADING.
           05  LINE 2 COLUMN 50  PIC X(16) VALUE 'INVENTORY REPORT'.


produces on line 360 of prog.c of test 655

  memcpy (b_17 + 49, "INVENTORY REPORT", 16);
  memset (b_17 + 49 + 16, 32, 49);

which exceeds the 108 character buffer, it thinks has a buffer of 115 
characters.

When the report herding is changed to:
  ( the second 05 level line added to give a 132 character line length)

       01  TYPE IS REPORT HEADING.
           05  LINE 2 COLUMN 50  PIC X(16) VALUE 'INVENTORY REPORT'.
           05  LINE 2 COLUMN 132 PIC X VALUE " ".

 
then the code produced is:

  memcpy (b_17 + 49, "INVENTORY REPORT", 16);
  memset (b_17 + 49 + 16, 32, 116);
  memset (b_17 + 131, 32, 1);

and the second memset exceeds the 132 character buffer, it thinks it has a 
buffer of 182 characters




attached is the testsuite  log.


Attachment: testsuite.log
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]