summaryrefslogtreecommitdiffstats
path: root/freebsd/contrib/wpa/src/crypto/ms_funcs.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/contrib/wpa/src/crypto/ms_funcs.c')
-rw-r--r--freebsd/contrib/wpa/src/crypto/ms_funcs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/freebsd/contrib/wpa/src/crypto/ms_funcs.c b/freebsd/contrib/wpa/src/crypto/ms_funcs.c
index dda2ba7c..67e98dbf 100644
--- a/freebsd/contrib/wpa/src/crypto/ms_funcs.c
+++ b/freebsd/contrib/wpa/src/crypto/ms_funcs.c
@@ -50,7 +50,7 @@ static int utf8_to_ucs2(const u8 *utf8_string, size_t utf8_string_len,
WPA_PUT_LE16(ucs2_buffer + j,
((c & 0x1F) << 6) | (c2 & 0x3F));
j += 2;
- } else if (i == utf8_string_len ||
+ } else if (i == utf8_string_len - 1 ||
j >= ucs2_buffer_size - 1) {
/* incomplete surrogate */
return -1;