From e53e1c566ac9e2e9b829f1cdbfd5d27537053cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= Date: Mon, 28 Oct 2019 08:07:29 +0100 Subject: Fix some crashes and using null pointers --- core/crypto/hashing_context.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'core/crypto') diff --git a/core/crypto/hashing_context.cpp b/core/crypto/hashing_context.cpp index bd863f546b..b5aa0ddc18 100644 --- a/core/crypto/hashing_context.cpp +++ b/core/crypto/hashing_context.cpp @@ -50,6 +50,7 @@ Error HashingContext::start(HashType p_type) { Error HashingContext::update(PoolByteArray p_chunk) { ERR_FAIL_COND_V(ctx == NULL, ERR_UNCONFIGURED); size_t len = p_chunk.size(); + ERR_FAIL_COND_V(len == 0, FAILED); PoolByteArray::Read r = p_chunk.read(); switch (type) { case HASH_MD5: -- cgit v1.2.3