commit ec8ec4c: [Minor] Remove assertion

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Jul 30 20:21:08 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-07-30 21:18:57 +0100
URL: https://github.com/rspamd/rspamd/commit/ec8ec4c6d0daf956f58a5c26d9a5bd8be082fa3f

[Minor] Remove assertion

---
 src/rspamadm/signtool.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/rspamadm/signtool.c b/src/rspamadm/signtool.c
index 03f6ac60e..555937966 100644
--- a/src/rspamadm/signtool.c
+++ b/src/rspamadm/signtool.c
@@ -344,7 +344,13 @@ rspamadm_sign_file (const gchar *fname, struct rspamd_cryptobox_keypair *kp)
 	}
 
 	rspamd_snprintf (sigpath, sizeof (sigpath), "%s%s", fname, suffix);
-	g_assert (write (fd_sig, sig, rspamd_cryptobox_signature_bytes (mode)) != -1);
+
+	if (write (fd_sig, sig, rspamd_cryptobox_signature_bytes (mode)) == -1) {
+		rspamd_fprintf (stderr, "cannot write signature to %s: %s\n", sigpath,
+				strerror (errno));
+		exit (errno);
+	}
+
 	close (fd_sig);
 	munmap (map, st.st_size);
 


More information about the Commits mailing list