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/libiconv_modules/HZ | |
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/libiconv_modules/HZ')
-rw-r--r-- | lib/libiconv_modules/HZ/citrus_hz.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/libiconv_modules/HZ/citrus_hz.c b/lib/libiconv_modules/HZ/citrus_hz.c index 6d0b6d8..f9eb006 100644 --- a/lib/libiconv_modules/HZ/citrus_hz.c +++ b/lib/libiconv_modules/HZ/citrus_hz.c @@ -65,8 +65,8 @@ typedef enum { } charset_t; typedef struct { - int end; int start; + int end; int width; } range_t; @@ -505,12 +505,12 @@ _citrus_HZ_encoding_module_uninit(_HZEncodingInfo *ei) } static int -_citrus_HZ_parse_char(void **context, const char *name __unused, const char *s) +_citrus_HZ_parse_char(void *context, const char *name __unused, const char *s) { escape_t *escape; void **p; - p = (void **)*context; + p = (void **)context; escape = (escape_t *)p[0]; if (escape->ch != '\0') return (EINVAL); @@ -522,14 +522,14 @@ _citrus_HZ_parse_char(void **context, const char *name __unused, const char *s) } static int -_citrus_HZ_parse_graphic(void **context, const char *name, const char *s) +_citrus_HZ_parse_graphic(void *context, const char *name, const char *s) { _HZEncodingInfo *ei; escape_t *escape; graphic_t *graphic; void **p; - p = (void **)*context; + p = (void **)context; escape = (escape_t *)p[0]; ei = (_HZEncodingInfo *)p[1]; graphic = malloc(sizeof(*graphic)); @@ -591,13 +591,13 @@ _CITRUS_PROP_HINT_END }; static int -_citrus_HZ_parse_escape(void **context, const char *name, const char *s) +_citrus_HZ_parse_escape(void *context, const char *name, const char *s) { _HZEncodingInfo *ei; escape_t *escape; void *p[2]; - ei = (_HZEncodingInfo *)*context; + ei = (_HZEncodingInfo *)context; escape = malloc(sizeof(*escape)); if (escape == NULL) return (EINVAL); |