The asserts in fromstruct were too strong - it's possible to have a non-NULL key and keylen == 0 if the pointer is to a 0 byte allocation.
The asserts in fromstruct were too strong - it's possible to have a non-NULL key and keylen == 0 if the pointer is to a 0 byte allocation.