libxcrypt/libxcrypt-4.4.0-use_XCRYPT_STRCPY_OR_ABORT_in_crypt_nt_rn.patch

36 lines
1.2 KiB
Diff

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