From 1cbbe6f2d4f3072dbd2c8607cd56bea514637d82 Mon Sep 17 00:00:00 2001 From: tijl Date: Tue, 15 Apr 2014 09:49:44 +0000 Subject: MFC r263986: - In the libiconv module for ISO 2022 restore the original order of the fields of a private struct such that variables of this type are initialised correctly. Fixes conversion from ISO 2022. Also do this in the BIG5 module to prevent similar errors in the future. - In the libiconv module for EUC-TW replace 2^cs with 1<ci_ops->io_uninit_shared == NULL || ci->ci_ops->io_init_context == NULL || ci->ci_ops->io_uninit_context == NULL || - ci->ci_ops->io_convert == NULL) + ci->ci_ops->io_convert == NULL) { + ret = EINVAL; goto err; + } /* initialize the converter */ ret = (*ci->ci_ops->io_init_shared)(ci, src, dst); diff --git a/lib/libc/iconv/citrus_lookup.c b/lib/libc/iconv/citrus_lookup.c index 09b1298..bb9934a 100644 --- a/lib/libc/iconv/citrus_lookup.c +++ b/lib/libc/iconv/citrus_lookup.c @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_lookup.c,v 1.6 2009/02/03 04:58:38 lukem Exp $ */ +/* $NetBSD: citrus_lookup.c,v 1.7 2012/05/04 16:45:05 joerg Exp $ */ /*- * Copyright (c)2003 Citrus Project, diff --git a/lib/libc/iconv/citrus_mapper.c b/lib/libc/iconv/citrus_mapper.c index 43fa4b0..ea65ae9 100644 --- a/lib/libc/iconv/citrus_mapper.c +++ b/lib/libc/iconv/citrus_mapper.c @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_mapper.c,v 1.7 2008/07/25 14:05:25 christos Exp $ */ +/* $NetBSD: citrus_mapper.c,v 1.10 2012/06/08 07:49:42 martin Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -244,8 +244,10 @@ mapper_open(struct _citrus_mapper_area *__restrict ma, if (!cm->cm_ops->mo_init || !cm->cm_ops->mo_uninit || !cm->cm_ops->mo_convert || - !cm->cm_ops->mo_init_state) + !cm->cm_ops->mo_init_state) { + ret = EINVAL; goto err; + } /* allocate traits structure */ cm->cm_traits = malloc(sizeof(*cm->cm_traits)); diff --git a/lib/libc/iconv/citrus_memstream.c b/lib/libc/iconv/citrus_memstream.c index d7ad4fd..f99a19d 100644 --- a/lib/libc/iconv/citrus_memstream.c +++ b/lib/libc/iconv/citrus_memstream.c @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_memstream.c,v 1.4 2009/02/03 05:02:12 lukem Exp $ */ +/* $NetBSD: citrus_memstream.c,v 1.5 2012/03/13 21:13:31 christos Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -44,8 +44,7 @@ _citrus_memory_stream_getln(struct _citrus_memory_stream * __restrict ms, size_t * __restrict rlen) { const uint8_t *h, *p; - size_t ret; - int i; + size_t i, ret; if (ms->ms_pos>=_region_size(&ms->ms_region)) return (NULL); diff --git a/lib/libc/iconv/citrus_mmap.c b/lib/libc/iconv/citrus_mmap.c index 2aaf73c..f8e96d1 100644 --- a/lib/libc/iconv/citrus_mmap.c +++ b/lib/libc/iconv/citrus_mmap.c @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_mmap.c,v 1.3 2005/01/19 00:52:37 mycroft Exp $ */ +/* $NetBSD: citrus_mmap.c,v 1.4 2011/10/15 23:00:01 christos Exp $ */ /*- * Copyright (c)2003 Citrus Project, diff --git a/lib/libc/iconv/citrus_prop.c b/lib/libc/iconv/citrus_prop.c index 0e6d34a..28318de 100644 --- a/lib/libc/iconv/citrus_prop.c +++ b/lib/libc/iconv/citrus_prop.c @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_prop.c,v 1.3 2006/11/22 23:47:21 tnozaki Exp $ */ +/* $NetBSD: citrus_prop.c,v 1.4 2011/03/30 08:22:01 jruoho Exp $ */ /*- * Copyright (c)2006 Citrus Project, diff --git a/lib/libc/iconv/citrus_prop.h b/lib/libc/iconv/citrus_prop.h index 2962154..48fc066 100644 --- a/lib/libc/iconv/citrus_prop.h +++ b/lib/libc/iconv/citrus_prop.h @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_prop.h,v 1.3 2006/11/23 13:59:03 tnozaki Exp $ */ +/* $NetBSD: citrus_prop.h,v 1.5 2011/05/23 14:52:32 joerg Exp $ */ /*- * Copyright (c)2006 Citrus Project, @@ -82,7 +82,7 @@ struct _citrus_prop_hint_t { #define _CITRUS_PROP_HINT_NUM(name, cb) \ { name, _CITRUS_PROP_NUM, { .num = { cb } } } #define _CITRUS_PROP_HINT_END \ - { NULL, _CITRUS_PROP_NUM, { .num = { 0 } } } + { .name = NULL } __BEGIN_DECLS int _citrus_prop_parse_variable(const _citrus_prop_hint_t * __restrict, diff --git a/lib/libc/iconv/citrus_stdenc.c b/lib/libc/iconv/citrus_stdenc.c index b6562f8..cef530e 100644 --- a/lib/libc/iconv/citrus_stdenc.c +++ b/lib/libc/iconv/citrus_stdenc.c @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_stdenc.c,v 1.3 2005/10/29 18:02:04 tshiozak Exp $ */ +/* $NetBSD: citrus_stdenc.c,v 1.4 2011/11/19 18:39:58 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -102,8 +102,10 @@ _citrus_stdenc_open(struct _citrus_stdenc * __restrict * __restrict rce, ce->ce_ops->eo_cstomb == NULL || ce->ce_ops->eo_mbtowc == NULL || ce->ce_ops->eo_wctomb == NULL || - ce->ce_ops->eo_get_state_desc == NULL) + ce->ce_ops->eo_get_state_desc == NULL) { + ret = EINVAL; goto bad; + } /* allocate traits */ ce->ce_traits = malloc(sizeof(*ce->ce_traits)); -- cgit v1.1