From 95a86a971a26592ce38fa66c56168707a140d1d3 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Sat, 9 Jan 2010 23:29:05 +0100
Subject: [PATCH] unistr/u8-to-u32: Reject invalid input.

---
 ChangeLog                | 6 ++++++
 lib/unistr/u8-to-u32.c   | 2 +-
 modules/unistr/u8-to-u32 | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8055a731a9..f722570dbb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2010-01-09  Bruno Haible  <bruno@clisp.org>
 
+	unistr/u8-to-u32: Reject invalid input.
+	* lib/unistr/u8-to-u32.c (u8_to_u32): Call u8_mbtoucr instead of
+	u8_mbtouc.
+	* modules/unistr/u8-to-u32 (Depends-on): Add unistr/u8-mbtoucr.
+	Remove unistr/u8-mbtouc.
+
 	unistr/u8-to-u16: Reject invalid input.
 	* lib/unistr/u8-to-u16.c (u8_to_u16): Call u8_mbtoucr instead of
 	u8_mbtouc.
diff --git a/lib/unistr/u8-to-u32.c b/lib/unistr/u8-to-u32.c
index d1e71c1e0a..de2a35e6fb 100644
--- a/lib/unistr/u8-to-u32.c
+++ b/lib/unistr/u8-to-u32.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-u32 b/modules/unistr/u8-to-u32
index 7b3dcb5b66..a3d27d9341 100644
--- a/modules/unistr/u8-to-u32
+++ b/modules/unistr/u8-to-u32
@@ -6,7 +6,7 @@ lib/unistr/u8-to-u32.c
 
 Depends-on:
 unistr/base
-unistr/u8-mbtouc
+unistr/u8-mbtoucr
 
 configure.ac:
 
-- 
2.30.2