/*
* Exim - an Internet mail transport agent
*
- * Copyright (C) 2010 - 2018 Exim maintainers
+ * Copyright (c) The Exim Maintainers 2010 - 2023
* Copyright (c) University of Cambridge 1995 - 2009
+ * SPDX-License-Identifier: GPL-2.0-or-later
*
* Hash interface functions
*/
*/
static void
-native_sha1_end(sha1 *base, const uschar *text, int length, uschar *digest)
+native_sha1_end(sha1 * base, const uschar * text, int length, uschar * digest)
{
uschar work[64];
padding. If it has less than 56 bytes, we pad it out to 56 bytes as the
final chunk. */
-memcpy(work, text, length);
+if (length) memcpy(work, text, length);
work[length] = 0x80;
if (length > 55)