Bug 13367 – Buffer overflow when setting PATH

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2014-08-24T02:54:00Z
Last change time
2015-06-09T05:14:50Z
Keywords
pull
Assigned to
nobody
Creator
dlang-bugzilla

Comments

Comment #0 by dlang-bugzilla — 2014-08-24T02:54:23Z
/////////////////////////// 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
Comment #1 by verylonglogin.reg — 2014-08-24T11:05:44Z
Comment #2 by github-bugzilla — 2014-08-25T13:02:18Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/46d0e0108baf3ddcf4d9b93b3fd219b620033902 Fix Issue 13367 - Buffer overflow when setting PATH Fixup for pull #2332. https://github.com/D-Programming-Language/phobos/commit/2d7bcea08b304a9c12011a8f155d119b182d2487 Merge pull request #2459 from denis-sh/fix-temp-c-string-allocation Fix Issue 13367 - Buffer overflow when setting PATH