public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/7422: strstreambuf frees buffer when beeing in frozen state
@ 2002-08-03 13:19 bkoz
  0 siblings, 0 replies; 2+ messages in thread
From: bkoz @ 2002-08-03 13:19 UTC (permalink / raw)
  To: bkoz, bkoz, gcc-bugs, gcc-prs, nobody, rschiele, schwab

Synopsis: strstreambuf frees buffer when beeing in frozen state

Responsible-Changed-From-To: unassigned->bkoz
Responsible-Changed-By: bkoz
Responsible-Changed-When: Sat Aug  3 13:19:26 2002
Responsible-Changed-Why:
    Mine.
State-Changed-From-To: open->closed
State-Changed-By: bkoz
State-Changed-When: Sat Aug  3 13:19:26 2002
State-Changed-Why:
    Fixed in 3.3. I'll back-port to 3.2.1. 
    
    Note this always worked with <sstream> and ostringstreams.
    If you'd like to check in an addition to the stringstream testsuite, I'm open to the idea.
    
    -benjamin

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7422


^ permalink raw reply	[flat|nested] 2+ messages in thread

* libstdc++/7422: strstreambuf frees buffer when beeing in frozen state
@ 2002-07-28  4:06 rschiele
  0 siblings, 0 replies; 2+ messages in thread
From: rschiele @ 2002-07-28  4:06 UTC (permalink / raw)
  To: gcc-gnats; +Cc: bkoz, schwab

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2214 bytes --]


>Number:         7422
>Category:       libstdc++
>Synopsis:       strstreambuf frees buffer when beeing in frozen state
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 28 04:06:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Robert Schiele
>Release:        3.1.1
>Organization:
>Environment:
System: independent
Architecture: independent
host: independent
build: independent
target: independent
Configured with: /home/schiele/gcccvs/gcc-3.1.1/configure --enable-threads=posix --prefix=/opt/Pkg/Linux/i686/gcc311 --enable-languages=c,c++,f77,objc --disable-libgcj --with-gxx-include-dir=/opt/Pkg/Linux/i686/gcc311/include/g++ --with-system-zlib --enable-shared --enable-__cxa_atexit i486-suse-linux
>Description:
The attached sample program shows that strstreambuf frees his buffer also he was forced to frozen mode by calling the str() method. Because of that the generated string can be overwritten by code that reallocates this memory.

This is a regression to gcc 3.1!

I have not checked that, but possibly this is related to http://gcc.gnu.org/ml/gcc-patches/2002-05/msg01204.html and/or http://gcc.gnu.org/ml/libstdc++/2002-06/msg00089.html.
>How-To-Repeat:
# g++ -o strstreambug strstreambug.cc
[header warning]
# ./strstreambug
s(0x804a118):Text
s(0x804a118):ñòóôõö÷øùúûüýþÿ

should be (gcc-3.1):
# ./strstreambug
s(0x804a118):Text
s(0x804a118):Text
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="strstreambug.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="strstreambug.cc"

I2luY2x1ZGUgPHN0cnN0cmVhbT4KI2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50IG1haW4oKSB7CiAg
ICBjaGFyKiBzOwogICAgewoJc3RkOjpvc3Ryc3RyZWFtIHQ7CgkKCXQgPDwgIlRleHQiIDw8IHN0
ZDo6ZW5kczsKCXMgPSB0LnN0cigpOwoJc3RkOjpjb3V0IDw8ICJzKCIgPDwgKHZvaWQqKXMgPDwg
Iik6IiA8PCBzIDw8IHN0ZDo6ZW5kbDsKICAgIH0KICAgIGNoYXIqIGEgPSBuZXcgY2hhclsxNl07
CiAgICBmb3IgKGludCBqID0gMDsgaiA8IDE2OyArK2opCglhW2pdID0gMjQxICsgajsKICAgIHN0
ZDo6Y291dCA8PCAicygiIDw8ICh2b2lkKilzIDw8ICIpOiIgPDwgcyA8PCBzdGQ6OmVuZGw7Cn0K


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-03 20:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-03 13:19 libstdc++/7422: strstreambuf frees buffer when beeing in frozen state bkoz
  -- strict thread matches above, loose matches on Subject: below --
2002-07-28  4:06 rschiele

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).