www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13367] New: Buffer overflow when setting PATH


          Issue ID: 13367
           Summary: Buffer overflow when setting PATH
           Product: D
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: thecybershadow gmail.com

/////////////////////////// testPath.d ///////////////////////////
import std.process;

void main()
    foreach (n; 0..50)
        environment["PATH"] = environment["PATH"] ~ `;C:\Example`;

This program will freeze on Win32 and crash on Win64. The stack trace is
corrupted, I assume a buffer on the stack is being overflown.

Introduced in https://github.com/D-Programming-Language/phobos/pull/2332

Aug 23 2014