Blame libxcrypt-4.4.0-use_XCRYPT_STRCPY_OR_ABORT_in_crypt_nt_rn.patch

b98b97d
From 664bfda5a51dbaa75904b29a7cd3c51888db6bd9 Mon Sep 17 00:00:00 2001
b98b97d
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
b98b97d
Date: Wed, 21 Nov 2018 18:27:51 +0100
b98b97d
Subject: [PATCH] Use XCRYPT_STRCPY_OR_ABORT in crypt_nt_rn.
b98b97d
b98b97d
---
b98b97d
 crypt-nthash.c | 8 ++++----
b98b97d
 1 file changed, 4 insertions(+), 4 deletions(-)
b98b97d
b98b97d
diff --git a/crypt-nthash.c b/crypt-nthash.c
b98b97d
index bb7c1ff..83c45ea 100644
b98b97d
--- a/crypt-nthash.c
b98b97d
+++ b/crypt-nthash.c
b98b97d
@@ -49,9 +49,9 @@
b98b97d
 
b98b97d
 void
b98b97d
 crypt_nt_rn (const char *phrase, size_t ARG_UNUSED (phr_size),
b98b97d
-                 const char *setting, size_t ARG_UNUSED (set_size),
b98b97d
-                 uint8_t *output, size_t out_size,
b98b97d
-                 void *scratch, size_t scr_size)
b98b97d
+             const char *setting, size_t ARG_UNUSED (set_size),
b98b97d
+             uint8_t *output, size_t out_size,
b98b97d
+             void *scratch, size_t scr_size)
b98b97d
 {
b98b97d
   size_t unipwLen;
b98b97d
   int i;
b98b97d
@@ -86,7 +86,7 @@ crypt_nt_rn (const char *phrase, size_t ARG_UNUSED (phr_size),
b98b97d
   MD4_Update (ctx, unipw, unipwLen*sizeof(uint16_t));
b98b97d
   MD4_Final (hash, ctx);
b98b97d
 
b98b97d
-  output = (uint8_t *)stpcpy ((char *)output, magic);
b98b97d
+  output += XCRYPT_STRCPY_OR_ABORT (output, out_size, magic);
b98b97d
   *output++ = '$';
b98b97d
   for (i = 0; i < 16; i++)
b98b97d
     {