Testsuite: tidying
[exim.git] / src / src / hash.c
index 85e10d5d515fcad1b143a125042b6b0a70de07a8..17a52fe43effc6b5976546410d5d19e968c48fa7 100644 (file)
@@ -1,8 +1,9 @@
 /*
  *  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
  */
@@ -407,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];
 
@@ -425,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)