History log of /freebsd-10-stable/lib/libiconv_modules/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
336324 16-Jul-2018 pfg

MFC r336115;
libiconv: correct undefined behavior.

Detected on NetBSD:
# nm /usr/lib/libc.so|grep sanit
/public/src.git/lib/libc/citrus/modules/citrus_mapper_std.c:173:8:
runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

Obtained from: NetBSD (CVS Rev. 1.11)

313626 11-Feb-2017 ngie

MFC r312506:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

291792 04-Dec-2015 bdrewery

MFC r289393:

Add more SUBDIR_PARALLEL.

283908 02-Jun-2015 tijl

MFC r283406,283418:

Fix decoding of UTF-7 when a base64 encoded chunk appears at the end of
the input buffer.

_citrus_UTF7_mbtoutf16 stored the decoder state at the beginning so it
could restore this state on an incomplete character such that the next
call would restart the decoding. The problem was that "-" (end of base64
mode) at the end of a string was also treated as an incomplete character
but was also removed from the state buffer. So the initial state would be
restored (with base64 mode) and the next call would no longer see the "-"
so it continued in base64 mode.

This state saving/restoring isn't needed here. It's already handled
elsewhere (citrus_iconv_std.c:_citrus_iconv_std_iconv_convert) so just
remove it.

Also initialise *nresult.

When only 2 bytes can be read from a 4 byte UTF-16 character in a base64
encoded chunk of a UTF-7 string, treat that as an incomplete character and
return an error instead of a shift sequence and no error.

Also check that the low 2 bytes have a valid value.

PR: 200398

282275 30-Apr-2015 tijl

MFC r275805:

Fix incorrect type of "invalids" argument in __iconv() prototype.

MFC r281550,281591:

Remove the const qualifier from iconv(3) to comply with POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html

Adjust all code that calls iconv.

PR: 199099


/freebsd-10-stable/UPDATING
/freebsd-10-stable/bin/csh/config.h
/freebsd-10-stable/bin/csh/iconv_stub.h
/freebsd-10-stable/contrib/smbfs/include/netsmb/smb_lib.h
/freebsd-10-stable/contrib/smbfs/lib/smb/nls.c
/freebsd-10-stable/contrib/smbfs/lib/smb/print.c
/freebsd-10-stable/contrib/smbfs/lib/smb/rq.c
/freebsd-10-stable/include/iconv.h
/freebsd-10-stable/lib/libarchive/Makefile
/freebsd-10-stable/lib/libc/iconv/__iconv.c
/freebsd-10-stable/lib/libc/iconv/bsd_iconv.c
/freebsd-10-stable/lib/libc/iconv/citrus_iconv.h
/freebsd-10-stable/lib/libc/iconv/citrus_iconv_local.h
/freebsd-10-stable/lib/libc/iconv/citrus_none.c
/freebsd-10-stable/lib/libc/iconv/citrus_stdenc.h
/freebsd-10-stable/lib/libc/iconv/citrus_stdenc_local.h
/freebsd-10-stable/lib/libc/iconv/citrus_stdenc_template.h
/freebsd-10-stable/lib/libc/iconv/iconv-internal.h
/freebsd-10-stable/lib/libc/iconv/iconv.3
/freebsd-10-stable/lib/libc/iconv/iconv.c
/freebsd-10-stable/lib/libc/iconv/iconv_compat.c
/freebsd-10-stable/lib/libc/locale/cXXrtomb_iconv.h
/freebsd-10-stable/lib/libc/locale/mbrtocXX_iconv.h
BIG5/citrus_big5.c
DECHanyu/citrus_dechanyu.c
EUC/citrus_euc.c
EUCTW/citrus_euctw.c
GBK2K/citrus_gbk2k.c
HZ/citrus_hz.c
ISO2022/citrus_iso2022.c
JOHAB/citrus_johab.c
MSKanji/citrus_mskanji.c
UES/citrus_ues.c
UTF1632/citrus_utf1632.c
UTF7/citrus_utf7.c
UTF8/citrus_utf8.c
VIQR/citrus_viqr.c
ZW/citrus_zw.c
iconv_none/citrus_iconv_none.c
iconv_std/citrus_iconv_std.c
/freebsd-10-stable/lib/libkiconv/xlat16_iconv.c
/freebsd-10-stable/sys/sys/param.h
/freebsd-10-stable/usr.bin/iconv/iconv.c
267665 20-Jun-2014 tijl

MFC r267436-267439:

- Replace malloc+memset with calloc.
- iconv_open(3): initialise ci_ilseq_invalid field of _citrus_iconv_shared
struct after allocation with malloc.
- iconvlist(3): reduce a memory leak by copying strings only once.
- iconv(1):
- Make invalids variable local to do_conv such that it prints the number
of invalid characters of the current file instead of an accumulated
value.
- Make do_conv return an error when invalid characters have been found.
Return EXIT_FAILURE from main if any file contained invalid characters.
This matches the behaviour of GNU iconv.
- Mark usage with __dead2 attribute.
- Make the long_options array const.

Tested by: Pavel Timofeev <timp87@gmail.com>

264497 15-Apr-2014 tijl

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<<cs. Fixes
conversion from EUC-TW.
- Synchronise iconv code with NetBSD. In most cases this only updates
the RCS id because the changes are already there or are NetBSD specific.
+ libc/iconv/citrus_csmapper.c: Add a comment.
+ libc/iconv/citrus_db_factory.c: Remove put16().
+ libc/iconv/citrus_iconv.c: Return EINVAL on error.
+ libc/iconv/citrus_mapper.c: Return EINVAL on error.
+ libc/iconv/citrus_memstream.c: Fix type of a variable.
+ libc/iconv/citrus_prop.h: Sync definition of _CITRUS_PROP_HINT_END.
+ libc/iconv/citrus_stdenc.c: Return EINVAL on error.
+ libiconv_modules/mapper_std/citrus_mapper_std.c: Plug memory leak.

Obtained from: NetBSD

262731 04-Mar-2014 tijl

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>

260497 09-Jan-2014 dim

MFC r260334:

Split the last gcc-specific flags off into CFLAGS.gcc. This also
removes the need to use -Qunused-arguments for clang throughout the
tree.

MFC r260369:

Apply band-aid for 32-bit compat libs failures after r260334: put back
-Qunused-arguments for clang for now, until I can figure out a way to
make it unneeded in all scenarios. Sorry about the breakage.

260264 04-Jan-2014 dim

MFC r260003:

In libiconv_modules, surround unused static _citrus_XXX_pack_state() and
_citrus_XXX_unpack_state() functions with #if 0, for now.

259073 07-Dec-2013 peter

Hoist all the mergeinfo up to the root in preparation for enforcing merges
to the root only. All MFC's were rerecorded to the root.

Going forward, if an MFC includes mergeinfo, it will need to be made to
the root and committed from the root. Merges with --ignore-ancestry
or diff | patch can go anywhere.

The mergeinfo in HEAD is in a bad state from years of neglect and manual
tampering and this was branched into 10.x. This confuses the coalescing
code and prevents it from doing its job.

Approved by: re (gjb, implicit)


/freebsd-10-stable/MAINTAINERS
/freebsd-10-stable/Makefile.inc1
/freebsd-10-stable/ObsoleteFiles.inc
/freebsd-10-stable/UPDATING
/freebsd-10-stable/bin/df
/freebsd-10-stable/bin/freebsd-version
/freebsd-10-stable/cddl
/freebsd-10-stable/cddl/contrib/opensolaris
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-10-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-10-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-10-stable/contrib/apr
/freebsd-10-stable/contrib/apr-util
/freebsd-10-stable/contrib/atf
/freebsd-10-stable/contrib/binutils
/freebsd-10-stable/contrib/bmake
/freebsd-10-stable/contrib/byacc
/freebsd-10-stable/contrib/bzip2
/freebsd-10-stable/contrib/com_err
/freebsd-10-stable/contrib/compiler-rt
/freebsd-10-stable/contrib/dialog
/freebsd-10-stable/contrib/dtc
/freebsd-10-stable/contrib/ee
/freebsd-10-stable/contrib/expat
/freebsd-10-stable/contrib/file
/freebsd-10-stable/contrib/gcc
/freebsd-10-stable/contrib/gdb
/freebsd-10-stable/contrib/gdtoa
/freebsd-10-stable/contrib/groff
/freebsd-10-stable/contrib/ipfilter
/freebsd-10-stable/contrib/ipfilter/ml_ipl.c
/freebsd-10-stable/contrib/ipfilter/mlfk_ipl.c
/freebsd-10-stable/contrib/ipfilter/mlh_rule.c
/freebsd-10-stable/contrib/ipfilter/mli_ipl.c
/freebsd-10-stable/contrib/ipfilter/mln_ipl.c
/freebsd-10-stable/contrib/ipfilter/mls_ipl.c
/freebsd-10-stable/contrib/ldns
/freebsd-10-stable/contrib/less
/freebsd-10-stable/contrib/libarchive
/freebsd-10-stable/contrib/libarchive/cpio
/freebsd-10-stable/contrib/libarchive/libarchive
/freebsd-10-stable/contrib/libarchive/libarchive_fe
/freebsd-10-stable/contrib/libarchive/tar
/freebsd-10-stable/contrib/libc++
/freebsd-10-stable/contrib/libc-vis
/freebsd-10-stable/contrib/libcxxrt
/freebsd-10-stable/contrib/libexecinfo
/freebsd-10-stable/contrib/libpcap
/freebsd-10-stable/contrib/libstdc++
/freebsd-10-stable/contrib/llvm
/freebsd-10-stable/contrib/llvm/tools/clang
/freebsd-10-stable/contrib/mtree
/freebsd-10-stable/contrib/ncurses
/freebsd-10-stable/contrib/netcat
/freebsd-10-stable/contrib/ntp
/freebsd-10-stable/contrib/nvi
/freebsd-10-stable/contrib/one-true-awk
/freebsd-10-stable/contrib/openbsm
/freebsd-10-stable/contrib/openpam
/freebsd-10-stable/contrib/openresolv
/freebsd-10-stable/contrib/pf
/freebsd-10-stable/contrib/sendmail
/freebsd-10-stable/contrib/serf
/freebsd-10-stable/contrib/smbfs
/freebsd-10-stable/contrib/subversion
/freebsd-10-stable/contrib/tcpdump
/freebsd-10-stable/contrib/tcsh
/freebsd-10-stable/contrib/tnftp
/freebsd-10-stable/contrib/top
/freebsd-10-stable/contrib/top/install-sh
/freebsd-10-stable/contrib/tzcode/stdtime
/freebsd-10-stable/contrib/tzcode/zic
/freebsd-10-stable/contrib/tzdata
/freebsd-10-stable/contrib/unbound
/freebsd-10-stable/contrib/wpa
/freebsd-10-stable/contrib/xz
/freebsd-10-stable/crypto/heimdal
/freebsd-10-stable/crypto/openssh
/freebsd-10-stable/crypto/openssl
/freebsd-10-stable/etc
/freebsd-10-stable/etc/rc.d
/freebsd-10-stable/gnu/lib
/freebsd-10-stable/gnu/usr.bin/binutils
/freebsd-10-stable/gnu/usr.bin/cc/cc_tools
/freebsd-10-stable/gnu/usr.bin/gdb
/freebsd-10-stable/include
/freebsd-10-stable/lib
/freebsd-10-stable/lib/libc
/freebsd-10-stable/lib/libc/stdtime
/freebsd-10-stable/lib/libc_nonshared
/freebsd-10-stable/lib/libfetch
/freebsd-10-stable/lib/libiconv_modules
/freebsd-10-stable/lib/libsmb
/freebsd-10-stable/lib/libthr
/freebsd-10-stable/lib/libutil
/freebsd-10-stable/lib/libvmmapi
/freebsd-10-stable/lib/libyaml
/freebsd-10-stable/lib/libz
/freebsd-10-stable/release
/freebsd-10-stable/release/doc
/freebsd-10-stable/sbin
/freebsd-10-stable/sbin/camcontrol
/freebsd-10-stable/sbin/dumpon
/freebsd-10-stable/sbin/hastd
/freebsd-10-stable/sbin/ifconfig
/freebsd-10-stable/sbin/ipfw
/freebsd-10-stable/sbin/nvmecontrol
/freebsd-10-stable/share
/freebsd-10-stable/share/examples/bhyve
/freebsd-10-stable/share/i18n/csmapper/JIS
/freebsd-10-stable/share/i18n/esdb/EUC
/freebsd-10-stable/share/man
/freebsd-10-stable/share/man/man4
/freebsd-10-stable/share/man/man4/bhyve.4
/freebsd-10-stable/share/man/man5
/freebsd-10-stable/share/man/man7
/freebsd-10-stable/share/man/man8
/freebsd-10-stable/share/misc
/freebsd-10-stable/share/mk
/freebsd-10-stable/share/mk/bsd.arch.inc.mk
/freebsd-10-stable/share/syscons
/freebsd-10-stable/share/zoneinfo
/freebsd-10-stable/sys
/freebsd-10-stable/sys/amd64/include/vmm.h
/freebsd-10-stable/sys/amd64/include/vmm_dev.h
/freebsd-10-stable/sys/amd64/include/vmm_instruction_emul.h
/freebsd-10-stable/sys/amd64/include/xen
/freebsd-10-stable/sys/amd64/vmm
/freebsd-10-stable/sys/boot
/freebsd-10-stable/sys/boot/i386/efi
/freebsd-10-stable/sys/boot/ia64/efi
/freebsd-10-stable/sys/boot/ia64/ski
/freebsd-10-stable/sys/boot/powerpc/boot1.chrp
/freebsd-10-stable/sys/boot/powerpc/ofw
/freebsd-10-stable/sys/cddl/contrib/opensolaris
/freebsd-10-stable/sys/conf
/freebsd-10-stable/sys/contrib/dev/acpica
/freebsd-10-stable/sys/contrib/dev/acpica/changes.txt
/freebsd-10-stable/sys/contrib/dev/acpica/common
/freebsd-10-stable/sys/contrib/dev/acpica/compiler
/freebsd-10-stable/sys/contrib/dev/acpica/components/debugger
/freebsd-10-stable/sys/contrib/dev/acpica/components/disassembler
/freebsd-10-stable/sys/contrib/dev/acpica/components/dispatcher
/freebsd-10-stable/sys/contrib/dev/acpica/components/events
/freebsd-10-stable/sys/contrib/dev/acpica/components/executer
/freebsd-10-stable/sys/contrib/dev/acpica/components/hardware
/freebsd-10-stable/sys/contrib/dev/acpica/components/namespace
/freebsd-10-stable/sys/contrib/dev/acpica/components/parser
/freebsd-10-stable/sys/contrib/dev/acpica/components/resources
/freebsd-10-stable/sys/contrib/dev/acpica/components/tables
/freebsd-10-stable/sys/contrib/dev/acpica/components/utilities
/freebsd-10-stable/sys/contrib/dev/acpica/include
/freebsd-10-stable/sys/contrib/dev/acpica/os_specific
/freebsd-10-stable/sys/contrib/ipfilter
/freebsd-10-stable/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
/freebsd-10-stable/sys/contrib/ipfilter/netinet/ip_raudio_pxy.c
/freebsd-10-stable/sys/contrib/libfdt
/freebsd-10-stable/sys/contrib/octeon-sdk
/freebsd-10-stable/sys/contrib/x86emu
/freebsd-10-stable/sys/dev/bvm
/freebsd-10-stable/sys/dev/fdt/fdt_ic_if.m
/freebsd-10-stable/sys/dev/hyperv
/freebsd-10-stable/sys/modules/hyperv
/freebsd-10-stable/sys/modules/vmm
/freebsd-10-stable/sys/x86/include/acpica_machdep.h
/freebsd-10-stable/tools
/freebsd-10-stable/tools/build
/freebsd-10-stable/tools/build/options
/freebsd-10-stable/tools/tools/atsectl
/freebsd-10-stable/usr.bin/calendar
/freebsd-10-stable/usr.bin/csup
/freebsd-10-stable/usr.bin/iscsictl
/freebsd-10-stable/usr.bin/procstat
/freebsd-10-stable/usr.sbin
/freebsd-10-stable/usr.sbin/bhyve
/freebsd-10-stable/usr.sbin/bhyvectl
/freebsd-10-stable/usr.sbin/bhyveload
/freebsd-10-stable/usr.sbin/bsdconfig
/freebsd-10-stable/usr.sbin/bsdinstall
/freebsd-10-stable/usr.sbin/ctladm
/freebsd-10-stable/usr.sbin/ctld
/freebsd-10-stable/usr.sbin/freebsd-update
/freebsd-10-stable/usr.sbin/jail
/freebsd-10-stable/usr.sbin/mergemaster
/freebsd-10-stable/usr.sbin/mount_smbfs
/freebsd-10-stable/usr.sbin/ndiscvt
/freebsd-10-stable/usr.sbin/pkg
/freebsd-10-stable/usr.sbin/rtadvctl
/freebsd-10-stable/usr.sbin/rtadvd
/freebsd-10-stable/usr.sbin/rtsold
/freebsd-10-stable/usr.sbin/zic
258496 23-Nov-2013 tijl

MFC r258316:

Bug fixes in iconv(3) UTF-7 support.

- Add ' to the list of directly encoded characters and * to the list of
optionally directly encoded characters as per RFC 2152.

- In _citrus_UTF7_mbtoutf16 on end of input when the next output character
has only been partially decoded, save a copy of the buffer of input
characters (not just its length). On the next call with more input
characters this buffer is reprocessed together with the new input to
form a fully decoded output character.

- At the end of a base64 encoded sequence fully discard '-' (BASE64_OUT)
by decrementing psenc->chlen and i. This is needed to make room in
psenc->ch (input buffer) in case the next input character starts a new
base64 encoded sequence. And also, if this is the end of input and no
output character can be returned, this brings the encoder in the initial
state as indicated by _citrus_UTF7_stdenc_get_state_desc_generic which
is used by the caller to distinguish between no output and partial
output.

- In _citrus_UTF7_mbrtowc_priv pass the s parameter (input pointer)
directly to _citrus_UTF7_mbtoutf16 instead of a copy (s0). This way s
is updated correctly in case of errors.

- In _citrus_UTF7_mbrtowc_priv when called with psenc->surrogate set
(previous call did not have enough input), retrieve the previously
decoded UTF-16 character from (psenc->cache >> psenc->bits) instead of
(psenc->cache >> 2).

Approved by: re (kib)

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


255298 06-Sep-2013 theraven

Use Makefile.inc instead of .export.


255297 06-Sep-2013 theraven

Fix the namespace pollution caused by iconv.h including stdbool.h
This broke any C89 ports that defined bool themselves, including things
like gcc, gtk, and so on.


252583 03-Jul-2013 peter

As a followup to r252547, propate const down the call stack.


219019 25-Feb-2011 gabor

Add the BSD-licensed Citrus iconv to the base system with default off
setting. It can be built by setting the WITH_ICONV knob. While this
knob is unset, the library part, the binaries, the header file and
the metadata files will not be built or installed so it makes no impact
on the system if left turned off.

This work is based on the iconv implementation in NetBSD but a great
number of improvements and feature additions have been included:

- Some utilities have been added. There is a conversion table generator,
which can compare conversion tables to reference data generated by
GNU libiconv. This helps ensuring conversion compatibility.
- UTF-16 surrogate support and some endianness issues have been fixed.
- The rather chaotic Makefiles to build metadata have been refactored
and cleaned up, now it is easy to read and it is also easier to add
support for new encodings.
- A bunch of new encodings and encoding aliases have been added.
- Support for 1->2, 1->3 and 1->4 mappings, which is needed for
transliterating with flying accents as GNU does, like "u.
- Lots of warnings have been fixed, the major part of the code is
now WARNS=6 clean.
- New section 1 and section 5 manual pages have been added.
- Some GNU-specific calls have been implemented:
iconvlist(), iconvctl(), iconv_canonicalize(), iconv_open_into()
- Support for GNU's //IGNORE suffix has been added.
- The "-" argument for stdin is now recognized in iconv(1) as per POSIX.
- The Big5 conversion module has been fixed.
- The iconv.h header files is supposed to be compatible with the
GNU version, i.e. sources should build with base iconv.h and
GNU libiconv. It also includes a macro magic to deal with the
char ** and const char ** incompatibility.
- GNU compatibility: "" or "char" means the current local
encoding in use
- Various cleanups and style(9) fixes.

Approved by: delphij (mentor)
Obtained from: The NetBSD Project
Sponsored by: Google Summer of Code 2009