summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-07-16 14:27:52 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-07-16 14:28:17 (GMT)
commitcabbb9d6a7b0fc8e87a02ea99984cb08770ffb61 (patch)
tree440a18a67272f691e2f314daf11747450de675ef /Utilities
parent273b09087714ede3112c115562b8b61d9caa1a8e (diff)
parent890beb19e6fdb23d7cfeeac212d7fe3a3d98e409 (diff)
downloadCMake-cabbb9d6a7b0fc8e87a02ea99984cb08770ffb61.zip
CMake-cabbb9d6a7b0fc8e87a02ea99984cb08770ffb61.tar.gz
CMake-cabbb9d6a7b0fc8e87a02ea99984cb08770ffb61.tar.bz2
Merge topic 'libuv-idna'
890beb19e6 libuv: backport IDNA input/output hardening fixes Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !9658
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmlibuv/src/idna.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Utilities/cmlibuv/src/idna.c b/Utilities/cmlibuv/src/idna.c
index 93d982c..858b19d 100644
--- a/Utilities/cmlibuv/src/idna.c
+++ b/Utilities/cmlibuv/src/idna.c
@@ -274,6 +274,9 @@ long uv__idna_toascii(const char* s, const char* se, char* d, char* de) {
char* ds;
int rc;
+ if (s == se)
+ return UV_EINVAL;
+
ds = d;
si = s;
@@ -308,8 +311,9 @@ long uv__idna_toascii(const char* s, const char* se, char* d, char* de) {
return rc;
}
- if (d < de)
- *d++ = '\0';
+ if (d >= de)
+ return UV_EINVAL;
+ *d++ = '\0';
return d - ds; /* Number of bytes written. */
}