Lookups: sub-path for dsearch
[exim.git] / src / src / hash.c
index 2b71463f1286820f6dfc7d86910cadbff310317e..17a52fe43effc6b5976546410d5d19e968c48fa7 100644 (file)
@@ -1,9 +1,9 @@
 /*
  *  Exim - an Internet mail transport agent
  *
- *  Copyright (c) The Exim Maintainers 2010 - 2022
+ *  Copyright (c) The Exim Maintainers 2010 - 2023
  *  Copyright (c) University of Cambridge 1995 - 2009
- *  SPDX-License-Identifier: GPL-2.0-only
+ *  SPDX-License-Identifier: GPL-2.0-or-later
  *
  *  Hash interface functions
  */
@@ -408,7 +408,7 @@ Returns:    nothing
 */
 
 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];
 
@@ -426,7 +426,7 @@ out to 64, process it, and then set up the final chunk as 56 bytes of
 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)