diff options
author | Alexander Nedotsukov <bland@FreeBSD.org> | 2010-02-06 00:55:44 +0000 |
---|---|---|
committer | Alexander Nedotsukov <bland@FreeBSD.org> | 2010-02-06 00:55:44 +0000 |
commit | b6036e9eea26369898a94f1b3045e0b60f334fdb (patch) | |
tree | fddce714fb70cd97b660d0d8a6c4e7c96ccc53fb | |
parent | a210de94523a37d94eaa05436388faa4f072d72b (diff) | |
download | ports-b6036e9eea26369898a94f1b3045e0b60f334fdb.tar.gz ports-b6036e9eea26369898a94f1b3045e0b60f334fdb.zip |
Notes
-rw-r--r-- | converters/libiconv/Makefile | 1 | ||||
-rw-r--r-- | converters/libiconv/files/patch-endless-wchar_t-loop | 32 |
2 files changed, 33 insertions, 0 deletions
diff --git a/converters/libiconv/Makefile b/converters/libiconv/Makefile index 657f2b62dba6..a6ee6b89099d 100644 --- a/converters/libiconv/Makefile +++ b/converters/libiconv/Makefile @@ -7,6 +7,7 @@ PORTNAME= libiconv PORTVERSION= 1.13.1 +PORTREVISION= 1 CATEGORIES= converters devel MASTER_SITES= ${MASTER_SITE_GNU} MASTER_SITE_SUBDIR= ${PORTNAME} diff --git a/converters/libiconv/files/patch-endless-wchar_t-loop b/converters/libiconv/files/patch-endless-wchar_t-loop new file mode 100644 index 000000000000..5882ce0ce498 --- /dev/null +++ b/converters/libiconv/files/patch-endless-wchar_t-loop @@ -0,0 +1,32 @@ +--- lib/loop_wchar.h ++++ lib/loop_wchar.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2000-2002, 2005-2006, 2008 Free Software Foundation, Inc. ++ * Copyright (C) 2000-2002, 2005-2006, 2008-2009 Free Software Foundation, Inc. + * This file is part of the GNU LIBICONV Library. + * + * The GNU LIBICONV Library is free software; you can redistribute it +@@ -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; +@@ -403,6 +404,12 @@ static size_t wchar_to_loop_convert (iconv_t icd, + break; + } + } ++ incount++; ++ if (incount > *inbytesleft) { ++ /* Incomplete input. */ ++ errno = EINVAL; ++ return -1; ++ } + } + } + return result; |