aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/openzfs/module/unicode/u8_textprep.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/openzfs/module/unicode/u8_textprep.c')
-rw-r--r--sys/contrib/openzfs/module/unicode/u8_textprep.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/sys/contrib/openzfs/module/unicode/u8_textprep.c b/sys/contrib/openzfs/module/unicode/u8_textprep.c
index 37d648b2172d..49e22c88cde7 100644
--- a/sys/contrib/openzfs/module/unicode/u8_textprep.c
+++ b/sys/contrib/openzfs/module/unicode/u8_textprep.c
@@ -6,7 +6,7 @@
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
@@ -23,6 +23,9 @@
* Use is subject to license terms.
*/
+/*
+ * Copyright 2022 MNX Cloud, Inc.
+ */
@@ -213,10 +216,10 @@ static const int8_t u8_number_of_bytes[0x100] = {
/* 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F */
I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_,
-/* 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F */
+/* 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F */
I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_,
-/* A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF */
+/* A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF */
I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_,
/* B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF */
@@ -1286,8 +1289,12 @@ TRY_THE_NEXT_MARK:
saved_l = l - disp[last];
while (p < oslast) {
- size = u8_number_of_bytes[*p];
- if (size <= 1 || (p + size) > oslast)
+ int8_t number_of_bytes = u8_number_of_bytes[*p];
+
+ if (number_of_bytes <= 1)
+ break;
+ size = number_of_bytes;
+ if ((p + size) > oslast)
break;
saved_p = p;
@@ -1378,8 +1385,10 @@ SAFE_RETURN:
*/
static size_t
collect_a_seq(size_t uv, uchar_t *u8s, uchar_t **source, uchar_t *slast,
- boolean_t is_it_toupper, boolean_t is_it_tolower,
- boolean_t canonical_decomposition, boolean_t compatibility_decomposition,
+ boolean_t is_it_toupper,
+ boolean_t is_it_tolower,
+ boolean_t canonical_decomposition,
+ boolean_t compatibility_decomposition,
boolean_t canonical_composition,
int *errnum, u8_normalization_states_t *state)
{