[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 06/58: Make sure the return value of 'scm_crypt' is alwa
From: |
Andy Wingo |
Subject: |
[Guile-commits] 06/58: Make sure the return value of 'scm_crypt' is always initialized. |
Date: |
Tue, 7 Aug 2018 06:58:29 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 921364df27423a2979dcd40481bcb65736148368
Author: Ludovic Courtès <address@hidden>
Date: Wed Jan 10 16:19:09 2018 +0100
Make sure the return value of 'scm_crypt' is always initialized.
* libguile/posix.c (scm_crypt): Always initialize 'ret'; error out even
when ERR is zero.
---
libguile/posix.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/libguile/posix.c b/libguile/posix.c
index b35dfbd..2e3fed6 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -1956,9 +1956,12 @@ SCM_DEFINE (scm_crypt, "crypt", 2, 0, 0,
c_ret = crypt (c_key, c_salt);
if (c_ret == NULL)
- /* Note: Do not throw until we've released 'scm_i_misc_mutex' since
- this would cause a deadlock down the path. */
- err = errno;
+ {
+ /* Note: Do not throw until we've released 'scm_i_misc_mutex'
+ since this would cause a deadlock down the path. */
+ err = errno;
+ ret = SCM_BOOL_F;
+ }
else
{
err = 0;
@@ -1967,7 +1970,7 @@ SCM_DEFINE (scm_crypt, "crypt", 2, 0, 0,
scm_dynwind_end ();
- if (err != 0)
+ if (scm_is_false (ret))
{
errno = err;
SCM_SYSERROR;
- [Guile-commits] branch lightning updated (0a01963 -> 0d00164), Andy Wingo, 2018/08/07
- [Guile-commits] 02/58: doc: Update LALR URL., Andy Wingo, 2018/08/07
- [Guile-commits] 06/58: Make sure the return value of 'scm_crypt' is always initialized.,
Andy Wingo <=
- [Guile-commits] 03/58: Fix 'crypt' deadlock upon error., Andy Wingo, 2018/08/07
- [Guile-commits] 01/58: Update NEWS for 2.2.3, Andy Wingo, 2018/08/07
- [Guile-commits] 07/58: No tabs in C code., Andy Wingo, 2018/08/07
- [Guile-commits] 04/58: 'load-thunk-from-memory' reports the correct error., Andy Wingo, 2018/08/07
- [Guile-commits] 13/58: srfi-18: 'thread-sleep!' timeout-as-a-number is relative., Andy Wingo, 2018/08/07
- [Guile-commits] 18/58: Fix typo in comment within numbers.c, Andy Wingo, 2018/08/07
- [Guile-commits] 08/58: Revert "Honor '%fresh-auto-compile'.", Andy Wingo, 2018/08/07
- [Guile-commits] 15/58: Fix eta-conversion edge cases in peval., Andy Wingo, 2018/08/07
- [Guile-commits] 17/58: Fix minor typo in the PEG documentation., Andy Wingo, 2018/08/07
- [Guile-commits] 20/58: Avoid inexact arithmetic in the type inferrer for 'sqrt'., Andy Wingo, 2018/08/07