[ 
https://issues.apache.org/jira/browse/STDCXX-989?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Travis Vitek updated STDCXX-989:
--------------------------------

    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...

{noformat}
$ 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
{noformat}

The definition of {{jmp_buf}} in {{include/rw/_csetjmp.h}} is a buffer of 8 
bytes.

  was:

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...

{noformat}
$ 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
{noformat}

The definition of {{jmp_buf}} in {{include/rw/_csetjmp.h}} is a buffer of 8 
bytes.


> [EDG C++ 3.9] definition of jmp_buf causes buffer overflow
> ----------------------------------------------------------
>
>                 Key: STDCXX-989
>                 URL: https://issues.apache.org/jira/browse/STDCXX-989
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.2.x
>         Environment: Linux/EDG C++ 3.9
>            Reporter: Travis Vitek
>             Fix For: 4.2.x
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 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...
> {noformat}
> $ 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
> {noformat}
> The definition of {{jmp_buf}} in {{include/rw/_csetjmp.h}} is a buffer of 8 
> bytes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to