[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 1/4] nfkc.c: Fix incorrect "items_written" returned by stringp
From: |
Karlson2k |
Subject: |
[PATCH v2 1/4] nfkc.c: Fix incorrect "items_written" returned by stringprep_utf8_to_ucs4() on platforms with sizeof(size_t) != sizeof(long) (i.e. Win x64). Also fixed crash in various function which use value of "items_written" (like tld_check_8z(), tld_check_lz()) |
Date: |
Mon, 4 Apr 2016 16:05:37 +0300 |
---
lib/nfkc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/nfkc.c b/lib/nfkc.c
index a843a2b..dbdf41b 100644
--- a/lib/nfkc.c
+++ b/lib/nfkc.c
@@ -362,7 +362,7 @@ g_unichar_to_utf8 (gunichar c, gchar * outbuf)
* This value must be freed with g_free().
**/
static gunichar *
-g_utf8_to_ucs4_fast (const gchar * str, glong len, glong * items_written)
+g_utf8_to_ucs4_fast (const gchar * str, gssize len, gsize * items_written)
{
gunichar *result;
gsize n_chars, i;
@@ -1011,7 +1011,7 @@ stringprep_utf8_to_ucs4 (const char *str, ssize_t len,
size_t * items_written)
if (u8_check ((const uint8_t *) str, n))
return NULL;
- return g_utf8_to_ucs4_fast (str, (glong) len, (glong *) items_written);
+ return g_utf8_to_ucs4_fast (str, len, items_written);
}
/**
--
2.8.0.windows.1
- [PATCH 0/3] Series of fixes for Win x64, Karlson2k, 2016/04/04
- [PATCH 1/3] nfkc.c: Fixed invalid variable types and invalid pointer casting., Karlson2k, 2016/04/04
- [PATCH 3/3] nfkc.c: reuse internally calculated lengths for buffer overrun protection, adjust internal API to public API: use ether string length OR null-termination, and do not stop processing on null char if length is specified., Karlson2k, 2016/04/04
- [PATCH 2/3] nfkc.c: int/size_t fixes in find_decomposition(), Karlson2k, 2016/04/04
- [PATCH v2 0/4] Crash fixed on Win x64, Karlson2k, 2016/04/04
- [PATCH v2 4/4] nfkc.c: reuse internally calculated lengths for buffer overrun protection, adjust internal API to public API: use ether string length OR null-termination, and do not stop processing on null char if length is specified., Karlson2k, 2016/04/04
- [PATCH v2 1/4] nfkc.c: Fix incorrect "items_written" returned by stringprep_utf8_to_ucs4() on platforms with sizeof(size_t) != sizeof(long) (i.e. Win x64). Also fixed crash in various function which use value of "items_written" (like tld_check_8z(), tld_check_lz()),
Karlson2k <=
- [PATCH v2 3/4] nfkc.c: int/size_t fixes in find_decomposition(), Karlson2k, 2016/04/04
- [PATCH v2 2/4] nfkc.c: Fixed invalid variable types and invalid pointer casting., Karlson2k, 2016/04/04