Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
4.2.x
-
None
-
Linux/EDG C++ 3.9
-
Incorrect Behavior
Description
The jmp_buf definition provided in include/ansi/_csetjmp.h is not as large as setjmp() is expecting. This causes a buffer overflow when running tests that use the test driver (rw_test), which results in data corruption. If you run the tests with --trace, you will see that the clause field of the output is always corrupt after the first use.
The following shows the expected size for us...
$ cat u.cpp; eccp u.cpp && ./a.out #include <setjmp.h> #include <stdio.h> int main () { printf ("%u\n", sizeof (jmp_buf)); return 0; } 156
The definition of jmp_buf in include/rw/_csetjmp.h is a buffer of 8 bytes.