From 630a387fb1ef0a2fda5fd73c02c37328d65d0755 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 9 Jan 2010 23:28:33 +0100 Subject: [PATCH] unistr/u8-to-u16: Reject invalid input. --- ChangeLog | 8 ++++++++ lib/unistr/u8-to-u16.c | 2 +- modules/unistr/u8-to-u16 | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 942adf6000..8055a731a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-01-09 Bruno Haible + + unistr/u8-to-u16: Reject invalid input. + * lib/unistr/u8-to-u16.c (u8_to_u16): Call u8_mbtoucr instead of + u8_mbtouc. + * modules/unistr/u8-to-u16 (Depends-on): Add unistr/u8-mbtoucr. + Remove unistr/u8-mbtouc. + 2010-01-09 Bruno Haible Tests for module 'getlogin'. diff --git a/lib/unistr/u8-to-u16.c b/lib/unistr/u8-to-u16.c index 6dac1b72ca..3745c2bdd8 100644 --- a/lib/unistr/u8-to-u16.c +++ b/lib/unistr/u8-to-u16.c @@ -58,7 +58,7 @@ FUNC (const SRC_UNIT *s, size_t n, DST_UNIT *resultbuf, size_t *lengthp) int count; /* Fetch a Unicode character from the input string. */ - count = u8_mbtouc (&uc, s, s_end - s); + count = u8_mbtoucr (&uc, s, s_end - s); if (count < 0) { if (!(result == resultbuf || result == NULL)) diff --git a/modules/unistr/u8-to-u16 b/modules/unistr/u8-to-u16 index 79dfb44bde..d87a81141f 100644 --- a/modules/unistr/u8-to-u16 +++ b/modules/unistr/u8-to-u16 @@ -6,7 +6,7 @@ lib/unistr/u8-to-u16.c Depends-on: unistr/base -unistr/u8-mbtouc +unistr/u8-mbtoucr unistr/u16-uctomb configure.ac: -- 2.30.2