33 строки
1.3 KiB
Diff
33 строки
1.3 KiB
Diff
From 686d54baf1df6e0775898f484d1670742898b3b2 Mon Sep 17 00:00:00 2001
|
|
From: z2_ <88509734+z2-2z@users.noreply.github.com>
|
|
Date: Wed, 17 Jul 2024 23:48:33 +0200
|
|
Subject: [PATCH] idn: tweak buffer use when converting with macidn
|
|
|
|
Closes #14215
|
|
---
|
|
Utilities/cmcurl/lib/idn.c | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/Utilities/cmcurl/lib/idn.c b/Utilities/cmcurl/lib/idn.c
|
|
index 8d6bfe7ce62ff5..3d7c1d820cd824 100644
|
|
--- a/Utilities/cmcurl/lib/idn.c
|
|
+++ b/Utilities/cmcurl/lib/idn.c
|
|
@@ -66,7 +66,7 @@ static CURLcode mac_idn_to_ascii(const char *in, char **out)
|
|
UIDNAInfo info = UIDNA_INFO_INITIALIZER;
|
|
char buffer[256] = {0};
|
|
(void)uidna_nameToASCII_UTF8(idna, in, -1, buffer,
|
|
- sizeof(buffer), &info, &err);
|
|
+ sizeof(buffer) - 1, &info, &err);
|
|
uidna_close(idna);
|
|
if(U_FAILURE(err)) {
|
|
return CURLE_URL_MALFORMAT;
|
|
@@ -93,7 +93,7 @@ static CURLcode mac_ascii_to_idn(const char *in, char **out)
|
|
UIDNAInfo info = UIDNA_INFO_INITIALIZER;
|
|
char buffer[256] = {0};
|
|
(void)uidna_nameToUnicodeUTF8(idna, in, -1, buffer,
|
|
- sizeof(buffer), &info, &err);
|
|
+ sizeof(buffer) - 1, &info, &err);
|
|
uidna_close(idna);
|
|
if(U_FAILURE(err)) {
|
|
return CURLE_URL_MALFORMAT;
|