diff --git a/converters/libiconv/Makefile b/converters/libiconv/Makefile index 06864321454..2b94c3de692 100644 --- a/converters/libiconv/Makefile +++ b/converters/libiconv/Makefile @@ -1,8 +1,9 @@ -# $OpenBSD: Makefile,v 1.32 2009/04/24 18:56:49 naddy Exp $ +# $OpenBSD: Makefile,v 1.33 2010/02/07 15:25:03 naddy Exp $ COMMENT= character set conversion library DISTNAME= libiconv-1.13 +PKGNAME= ${DISTNAME}p0 CATEGORIES= converters devel MASTER_SITES= ${MASTER_SITE_GNU:=libiconv/} diff --git a/converters/libiconv/patches/patch-lib_loop_wchar_h b/converters/libiconv/patches/patch-lib_loop_wchar_h new file mode 100644 index 00000000000..ec347e87de1 --- /dev/null +++ b/converters/libiconv/patches/patch-lib_loop_wchar_h @@ -0,0 +1,26 @@ +$OpenBSD: patch-lib_loop_wchar_h,v 1.4 2010/02/07 15:25:03 naddy Exp $ +--- lib/loop_wchar.h.orig Sat Feb 6 15:02:22 2010 ++++ lib/loop_wchar.h Sat Feb 6 15:02:28 2010 +@@ -321,7 +321,8 @@ static size_t wchar_to_loop_convert (iconv_t icd, + size_t result = 0; + while (*inbytesleft > 0) { + size_t incount; +- for (incount = 1; incount <= *inbytesleft; incount++) { ++ for (incount = 1; ; ) { ++ /* Here incount <= *inbytesleft. */ + char buf[BUF_SIZE]; + const char* inptr = *inbuf; + size_t inleft = incount; +@@ -402,6 +403,12 @@ static size_t wchar_to_loop_convert (iconv_t icd, + result += res; + break; + } ++ } ++ incount++; ++ if (incount > *inbytesleft) { ++ /* Incomplete input. */ ++ errno = EINVAL; ++ return -1; + } + } + }