summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--patches/monero/0001-polyseed.patch12
1 files changed, 6 insertions, 6 deletions
diff --git a/patches/monero/0001-polyseed.patch b/patches/monero/0001-polyseed.patch
index 9e3c061..5a39c36 100644
--- a/patches/monero/0001-polyseed.patch
+++ b/patches/monero/0001-polyseed.patch
@@ -517,14 +517,14 @@ index 000000000..b26f37574
+ utf8proc_ssize_t result;
+
+ result = utf8proc_decompose(reinterpret_cast<const uint8_t*>(str), 0, buffer, POLYSEED_STR_SIZE, options);
-+ if (result < 0) {
-+ return POLYSEED_STR_SIZE;
++ if (result < 0 || result > (POLYSEED_STR_SIZE - 1)) {
++ throw std::runtime_error("Unicode normalization failed");
+ }
-+ if (result > POLYSEED_STR_SIZE - 1) {
-+ return result;
-+ }
-+
++
+ result = utf8proc_reencode(buffer, result, options);
++ if (result < 0 || result > POLYSEED_STR_SIZE) {
++ throw std::runtime_error("Unicode normalization failed");
++ }
+
+ strcpy(norm, reinterpret_cast<const char*>(buffer));
+ sodium_memzero(buffer, POLYSEED_STR_SIZE);