List of Phobos functions that allocate memory?
Brad Anderson
eco at gnuk.net
Thu Feb 6 14:18:09 PST 2014
On Thursday, 6 February 2014 at 21:48:13 UTC, Dicebot wrote:
> On Thursday, 6 February 2014 at 19:54:27 UTC, Sean Kelly wrote:
>> Does this case even matter? Exceptions are not a normal
>> function of execution, and so should happen rarely to never.
>> And it's a time when I'd expect a delay anyway.
>
> Imagine intentionally crafted broken utf as user input in
> repeated requests. You don't have control over it.
>
> Now if Phobos would have only thrown exceptions in really
> _exceptional_ situations and handled broken input gracefully...
You should probably validate utf from all foreign sources. Catch
a problem with it as it comes in rather than in some arbitrary
part of your program.
http://dlang.org/phobos/std_utf.html#.validate
More information about the Digitalmars-d
mailing list