unistr/u8-to-u16: Reject invalid input.
authorIan Beckwith <ianb@erislabs.net>
Sun, 10 Jan 2010 00:54:06 +0000 (00:54 +0000)
committerIan Beckwith <ianb@erislabs.net>
Sun, 10 Jan 2010 00:54:06 +0000 (00:54 +0000)
(cherry picked from commit 630a387fb1ef0a2fda5fd73c02c37328d65d0755)

Conflicts:

ChangeLog

ChangeLog
NEWS.stable
lib/unistr/u8-to-u16.c
modules/unistr/u8-to-u16

index de42340..3f0483f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2010-01-09  Bruno Haible  <bruno@clisp.org>
 
+       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  <bruno@clisp.org>
+
        getlogin_r: Support for native Windows.
        * lib/getlogin_r.c: Include <windows.h>
        (getlogin_r): Implement for native Windows.
index 252a87f..e116b3d 100644 (file)
@@ -48,6 +48,10 @@ with the following additional commits:
     * [2cf2e37]->[0b0ac4a] dup2: work around mingw bug
     * [581419c]->[fad0fe1] lib/dup2.c (rpl_dup2): Improve comment.
     * [dd5823d]->[465b4d1] Tests for module 'getlogin_r'.
+    * [3361cfa]->[5bfd3af] getlogin_r: Add comment.
+    * [89b39ef]->[88bc1a6] getlogin_r: Small fixes.
+    * [570a589]->[d6b7bf8] getlogin_r: Support for native Windows.
+    * [630a387]->[] unistr/u8-to-u16: Reject invalid input.
 __NEXTCOMMITMARKER__
 
 ----------------------------------------------------------------------
index 6dac1b7..3745c2b 100644 (file)
@@ -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))
index 79dfb44..d87a811 100644 (file)
@@ -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: