diff options
author | tijl <tijl@FreeBSD.org> | 2014-03-04 11:43:01 +0000 |
---|---|---|
committer | tijl <tijl@FreeBSD.org> | 2014-03-04 11:43:01 +0000 |
commit | 64a908c93597fc7a32a06f4c07bfd9c9006c6062 (patch) | |
tree | 5045c4e0aaa9e69b40b3b439246baa178fa13df7 /lib/libc/iconv | |
parent | 4dd6e22c185e4b2e10499d050b5f3a25354a0f02 (diff) | |
download | FreeBSD-src-64a908c93597fc7a32a06f4c07bfd9c9006c6062.zip FreeBSD-src-64a908c93597fc7a32a06f4c07bfd9c9006c6062.tar.gz |
MFC r262441-262442,262447,262461-262464,262655:
- Consistently pass around context information using a simple pointer.
This fixes some dereferencing bugs in Chinese character set conversions.
- Fix Simplified Chinese character set conversions by switching around the
fields of an internal struct so it corresponds with the way variables of
this type are initialised.
- Fix an array index out of bounds bug in iconv VIQR (Vietnamese) module.
- Silence gcc warning about unsigned comparison with 0.
Also record r258316 and r258587 as merged so they no longer show up as
eligible.
PR: 185964
Submitted by: Manuel Mausz <manuel-freebsd@mausz.at>
Diffstat (limited to 'lib/libc/iconv')
-rw-r--r-- | lib/libc/iconv/citrus_prop.c | 5 | ||||
-rw-r--r-- | lib/libc/iconv/citrus_prop.h | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/libc/iconv/citrus_prop.c b/lib/libc/iconv/citrus_prop.c index c2d4829..0e6d34a 100644 --- a/lib/libc/iconv/citrus_prop.c +++ b/lib/libc/iconv/citrus_prop.c @@ -339,7 +339,7 @@ name_found: static int _citrus_prop_parse_element(struct _memstream * __restrict ms, - const _citrus_prop_hint_t * __restrict hints, void ** __restrict context) + const _citrus_prop_hint_t * __restrict hints, void * __restrict context) { int ch, errnum; #define _CITRUS_PROP_HINT_NAME_LEN_MAX 255 @@ -435,8 +435,7 @@ _citrus_prop_parse_variable(const _citrus_prop_hint_t * __restrict hints, if (ch == EOF || ch == '\0') break; _memstream_ungetc(&ms, ch); - errnum = _citrus_prop_parse_element( - &ms, hints, (void ** __restrict)context); + errnum = _citrus_prop_parse_element(&ms, hints, context); if (errnum != 0) return (errnum); } diff --git a/lib/libc/iconv/citrus_prop.h b/lib/libc/iconv/citrus_prop.h index db087a4..2962154 100644 --- a/lib/libc/iconv/citrus_prop.h +++ b/lib/libc/iconv/citrus_prop.h @@ -42,7 +42,7 @@ typedef struct _citrus_prop_hint_t _citrus_prop_hint_t; #define _CITRUS_PROP_CB0_T(_func_, _type_) \ typedef int (*_citrus_prop_##_func_##_cb_func_t) \ - (void ** __restrict, const char *, _type_); \ + (void * __restrict, const char *, _type_); \ typedef struct { \ _citrus_prop_##_func_##_cb_func_t func; \ } _citrus_prop_##_func_##_cb_t; @@ -52,7 +52,7 @@ _CITRUS_PROP_CB0_T(str, const char *) #define _CITRUS_PROP_CB1_T(_func_, _type_) \ typedef int (*_citrus_prop_##_func_##_cb_func_t) \ - (void ** __restrict, const char *, _type_, _type_); \ + (void * __restrict, const char *, _type_, _type_); \ typedef struct { \ _citrus_prop_##_func_##_cb_func_t func; \ } _citrus_prop_##_func_##_cb_t; |