From 3391dc49cd8ac296bd13aa07a2c0ea7d0b7db2fe Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Fri, 11 Nov 2016 15:30:31 +0100 Subject: [PATCH] Fix eventual null-pointer dereference --- src/event.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/event.c b/src/event.c index cc696d092..e9452a6ca 100644 --- a/src/event.c +++ b/src/event.c @@ -44,7 +44,10 @@ void event_call (const u32 id, hashcat_ctx_t *hashcat_ctx, const void *buf, cons event_ctx->old_len[i] = event_ctx->old_len[i - 1]; } - memcpy (event_ctx->old_buf[0], buf, len); + if (buf) + { + memcpy (event_ctx->old_buf[0], buf, len); + } event_ctx->old_len[0] = len; }