[erlang-patches] [PATCH] crypto: fix a few memleaks/undefined pointer dereferences

Sverker Eriksson <>
Mon Dec 16 16:23:54 CET 2013


On 12/16/2013 01:19 PM, Florian Zumbiehl wrote:
> ---
> Hi,
>
> now, those are the obviously broken cases -
Thanks. I'll put the patch in the pipe for R17.

> what I am wondering about is
> whether it is correct that almost none of the OpenSSL calls in crypto are
> being checked for memory allocation failures!?
Not sure what you mean. Can you give an example.

> IIUC, OpenSSL is configured
> to use enif_alloc(), which according to this ...
>
> http://www.erlang.org/doc/man/erl_nif.html#enif_alloc
>
> ... will return NULL in case of an allocation failure. Now, is that there
> just to confuse people because the function doesn't actually ever return in
> case of an allocation failure, or is this really severely broken? Am I
> missing something?
enif_alloc calls erts_alloc_fnf where "fnf" stands for "Failure Not 
Fatal" which means that it will return NULL on failure.


/Sverker



More information about the erlang-patches mailing list