Displaying 1 result from an estimated 1 matches for "virt_customize_crypt".
2018 Jan 29
1
[PATCH] customize: Correctly handle crypt(3) returning NULL.
...lt;errno.h>
#if HAVE_CRYPT_H
#include <crypt.h>
@@ -29,6 +30,7 @@
#include <caml/alloc.h>
#include <caml/memory.h>
#include <caml/mlvalues.h>
+#include <caml/unixsupport.h>
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
@@ -44,6 +46,8 @@ virt_customize_crypt (value keyv, value saltv)
* is not thread safe.
*/
r = crypt (String_val (keyv), String_val (saltv));
+ if (r == NULL)
+ unix_error (errno, (char *) "crypt", Nothing);
rv = caml_copy_string (r);
CAMLreturn (rv);
--
2.13.2