[Webkit-unassigned] [Bug 11737] Windows cookie code uses a reference to a destroyed temporary

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 1 20:59:03 PST 2006


http://bugs.webkit.org/show_bug.cgi?id=11737


ap at webkit.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ap at webkit.org




------- Comment #1 from ap at webkit.org  2006-12-01 20:59 PDT -------
This temporary should not be destroyed too early, according to C++ standard
12.2.5: "The temporary to which the reference is bound <...> persists for the
lifetime of the reference except as specified below <exceptions don't seem to
apply to this case>." Does MSVC destroy it too early?

However, there is another problem in this snippet - a temporary object cannot
be bound to a non-const reference, so it should be:
    const String& result = String(buffer, count-1); // Ignore the null
terminator.
    delete[] buffer;
    return result;


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list