[Issue 5492] New: immutable string can be changed by stdin.readln

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 26 12:52:21 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5492

           Summary: immutable string can be changed by stdin.readln
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: mrmocool at gmx.de


--- Comment #0 from Trass3r <mrmocool at gmx.de> 2011-01-26 12:50:13 PST ---
import std.stdio;

void main()
{
    immutable char[] buf = "hello";
    writefln("buf = %s",buf);
    stdin.readln(buf);
    writefln("buf = %s",buf);
}

compiles and runs without errors.
Steven said it segfaults on Linux.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list