digitalmars.D.bugs - [Issue 9126] New: parse!int fails on size_t.max+1 digits long input (overflow)
- d-bugmail puremagic.com (32/32) Dec 08 2012 http://d.puremagic.com/issues/show_bug.cgi?id=9126
- d-bugmail puremagic.com (10/10) Dec 08 2012 http://d.puremagic.com/issues/show_bug.cgi?id=9126
- d-bugmail puremagic.com (9/9) Dec 09 2012 http://d.puremagic.com/issues/show_bug.cgi?id=9126
- d-bugmail puremagic.com (9/9) Dec 09 2012 http://d.puremagic.com/issues/show_bug.cgi?id=9126
http://d.puremagic.com/issues/show_bug.cgi?id=9126 Summary: parse!int fails on size_t.max+1 digits long input (overflow) Product: D Version: D1 & D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nobody puremagic.com ReportedBy: nilsbossung googlemail.com --- Comment #0 from Nils <nilsbossung googlemail.com> 2012-12-08 23:40:03 PST --- std.conv.parse!int uses a counter just to see if anything could be parsed. When the counter overflows, the state jumps back to "at start", which is wrong, of course. Test case (takes some minutes): --- import std.conv: parse; import std.range: chain, repeat; void main() { auto seven = chain(repeat(cast(dchar) '0', size_t.max), "7"); assert(parse!int(seven) == 7); auto eleven = chain(repeat(cast(dchar) '0', size_t.max), "B"); assert(parse!int(eleven, 13) == 11); } --- Pull request follows. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 08 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9126 Nils <nilsbossung googlemail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull --- Comment #1 from Nils <nilsbossung googlemail.com> 2012-12-08 23:50:44 PST --- https://github.com/D-Programming-Language/phobos/pull/996 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 08 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9126 --- Comment #2 from github-bugzilla puremagic.com 2012-12-09 17:50:16 PST --- Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/dc39ebebdc2cd9db78531bd766c21147ef99cd6f Merge pull request #996 from NilsBossung/parseoverflow Fix Issue 9126 - parse!int fails on size_t.max+1 digits long input (overflow) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 09 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9126 Nils <nilsbossung googlemail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 09 2012