std.database

landaire via Digitalmars-d digitalmars-d at puremagic.com
Wed Mar 2 10:28:34 PST 2016


On Wednesday, 2 March 2016 at 03:07:54 UTC, Rikki Cattermole 
wrote:
> Okay I've found a problem.
>
> Here is some code demonstrating it.
> http://dpaste.dzfl.pl/022c9e610a18
>
> Now take a look again at Database 
> https://github.com/cruisercoder/dstddb/blob/master/src/std/database/poly/database.d#L37
>
> Do you see the problem?
> The solution is simple.
>
> The client database type can be a struct or a class. It doesn't 
> matter too much (assuming you're going the way of ranges).
> But the intermediary representation must be on the heap and 
> should probably use the constructor and not a static create 
> method to get it.
> This way people can use other memory management solutions and 
> construct it however they like.

How is this a UAF? Isn't the struct copied?


More information about the Digitalmars-d mailing list