Thread overview
[Issue 16470] Segfault with negative array length
Sep 05, 2016
ag0aep6g@gmail.com
Sep 06, 2016
Lodovico Giaretta
Jan 11, 2017
Nemanja Boric
September 05, 2016
https://issues.dlang.org/show_bug.cgi?id=16470

ag0aep6g@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ag0aep6g@gmail.com

--- Comment #1 from ag0aep6g@gmail.com ---
There's no such thing as a negative length. -1 becomes size_t.max. Still shouldn't segfault, though. Should throw an OutOfMemoryError.

--
September 06, 2016
https://issues.dlang.org/show_bug.cgi?id=16470

--- Comment #2 from Lodovico Giaretta <lodovico@giaretart.net> ---
*** Issue 16469 has been marked as a duplicate of this issue. ***

--
January 05, 2017
https://issues.dlang.org/show_bug.cgi?id=16470

Alexandru Razvan Caciulescu <alexandru.razvan.c@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |trivial
                 CC|                            |alexandru.razvan.c@gmail.co
                   |                            |m

--
January 11, 2017
https://issues.dlang.org/show_bug.cgi?id=16470

bitter.taste@gmx.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bitter.taste@gmx.com

--- Comment #3 from bitter.taste@gmx.com ---
This is caused by not-so-wise decision to to allow the implicit conversion from {int,long} to u{int,long} (but not for {byte,short} to u{byte,short}, go figure) so even though it is possible to catch this error at compile time a blind eye is turned instead.

--
January 11, 2017
https://issues.dlang.org/show_bug.cgi?id=16470

Nemanja Boric <4burgos@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |4burgos@gmail.com

--- Comment #4 from Nemanja Boric <4burgos@gmail.com> ---
I made this PR a long ago, but received no attention: https://github.com/dlang/druntime/pull/1675

--
February 18, 2017
https://issues.dlang.org/show_bug.cgi?id=16470

--- Comment #5 from github-bugzilla@puremagic.com ---
Commit pushed to master at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/2d38937e3ff6597a143e83cf2d2d38c76b117d56 Fix issue 16470: Segfault with negative array length

If the array length is too large, and the element
size small enough, the overflow might go undetected
in the check while multiplying array size and element
size, but it can later manifest when adding padding, etc.

https://issues.dlang.org/show_bug.cgi?id=16470

--
February 18, 2017
https://issues.dlang.org/show_bug.cgi?id=16470

github-bugzilla@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
February 24, 2017
https://issues.dlang.org/show_bug.cgi?id=16470

--- Comment #6 from github-bugzilla@puremagic.com ---
Commit pushed to newCTFE at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/2d38937e3ff6597a143e83cf2d2d38c76b117d56 Fix issue 16470: Segfault with negative array length

--
March 22, 2017
https://issues.dlang.org/show_bug.cgi?id=16470

--- Comment #7 from github-bugzilla@puremagic.com ---
Commit pushed to stable at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/2d38937e3ff6597a143e83cf2d2d38c76b117d56 Fix issue 16470: Segfault with negative array length

--