From 2a188df857572a2ad238f19a2f995f315a1bb740 Mon Sep 17 00:00:00 2001 From: jsteube Date: Sun, 20 Nov 2016 20:58:56 +0100 Subject: [PATCH] Check fopen() return in logfile_append() --- src/logfile.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/logfile.c b/src/logfile.c index 3a954b078..c8d7b9bd2 100644 --- a/src/logfile.c +++ b/src/logfile.c @@ -51,6 +51,13 @@ void logfile_append (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...) FILE *fp = fopen (logfile_ctx->logfile, "ab"); + if (fp == NULL) + { + event_log_error (hashcat_ctx, "%s: %s", logfile_ctx->logfile, strerror (errno)); + + return; + } + lock_file (fp); va_list ap;