This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 13/14] Fix ucs4le_internal_loop in error case.
- From: Stefan Liebler <stli at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Cc: Stefan Liebler <stli at linux dot vnet dot ibm dot com>
- Date: Tue, 23 Feb 2016 10:21:17 +0100
- Subject: [PATCH 13/14] Fix ucs4le_internal_loop in error case.
- Authentication-results: sourceware.org; auth=none
- References: <1456219278-5258-1-git-send-email-stli at linux dot vnet dot ibm dot com>
When converting from UCS4LE to INTERNAL, the input-value is checked for a too
large value and the iconv() call sets errno to EILSEQ. In this case the inbuf
argument of the iconv() call should point to the invalid character, but it
points to the beginning of the inbuf.
Thus this patch updates the pointers inptrp and outptrp before returning in
this error case.
ChangeLog:
* iconv/gconv_simple.c (ucs4le_internal_loop): Update inptrp and
outptrp in case of an illegal input.
---
iconv/gconv_simple.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c
index 5412bd6..f66bf34 100644
--- a/iconv/gconv_simple.c
+++ b/iconv/gconv_simple.c
@@ -638,6 +638,8 @@ ucs4le_internal_loop (struct __gconv_step *step,
continue;
}
+ *inptrp = inptr;
+ *outptrp = outptr;
return __GCONV_ILLEGAL_INPUT;
}
--
2.3.0