Re: [PATCH] crypto: fix a few memleaks/undefined pointer dereferences
Sverker Eriksson <[email protected]> Mon, 16 Dec 2013 16:23:54 +0100
| Newsgroups | gmane.comp.lang.erlang.patches |
|---|---|
| Message-ID | <[email protected]> |
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 _______________________________________________ erlang-patches mailing list [email protected] http://erlang.org/mailman/listinfo/erlang-patches