diff --git a/0001-wrestool-Fix-get_resource_id_quoted-to-return-heap-a.patch b/0001-wrestool-Fix-get_resource_id_quoted-to-return-heap-a.patch new file mode 100644 index 0000000..6d859dd --- /dev/null +++ b/0001-wrestool-Fix-get_resource_id_quoted-to-return-heap-a.patch @@ -0,0 +1,87 @@ +From d72956a6de228c91d1fc48fd15448fadea9ab6cf Mon Sep 17 00:00:00 2001 +From: Frank Richter +Date: Sat, 10 Mar 2018 14:08:37 +0100 +Subject: [PATCH] wrestool: Fix get_resource_id_quoted() to return + heap-allocated string + +--- + NEWS | 4 ++++ + wrestool/restable.c | 21 +++++++++++++-------- + 2 files changed, 17 insertions(+), 8 deletions(-) + +diff --git a/NEWS b/NEWS +index 414bec4..086f8dc 100644 +--- a/NEWS ++++ b/NEWS +@@ -1,3 +1,7 @@ ++2018-??-??: ++ wrestool: Fix get_resource_id_quoted() to return heap-allocated string. ++ Found by Jonathan Liu. ++ + 2018-03-07: icoutils 0.32.3 released. + Fixed a segfault. (Martin Gieseking, Savannah bug 52319) + Updated Gnulib stuff. +diff --git a/wrestool/restable.c b/wrestool/restable.c +index 0d47d94..4d99687 100644 +--- a/wrestool/restable.c ++++ b/wrestool/restable.c +@@ -23,6 +23,7 @@ + #define N_(s) gettext_noop(s) + #include "common/intutil.h" + #include "xalloc.h" /* Gnulib */ ++#include "xvasprintf.h" /* Gnulib */ + #include "minmax.h" /* Gnulib */ + #include "common/error.h" + #include "wrestool.h" +@@ -125,6 +126,7 @@ print_resources_callback (WinLibrary *fi, WinResource *wr, + const char *type, *offset; + int32_t id; + size_t size; ++ char *type_quoted, *name_quoted, *lang_quoted; + + /* get named resource type if possible */ + type = NULL; +@@ -136,28 +138,31 @@ print_resources_callback (WinLibrary *fi, WinResource *wr, + if (offset == NULL) + return; + ++ type_quoted = get_resource_id_quoted(type_wr); ++ name_quoted = get_resource_id_quoted(name_wr); ++ lang_quoted = get_resource_id_quoted(lang_wr); + printf(_("--type=%s --name=%s%s%s [%s%s%soffset=0x%x size=%zu]\n"), +- get_resource_id_quoted(type_wr), +- get_resource_id_quoted(name_wr), ++ type_quoted, ++ name_quoted, + (lang_wr->id[0] != '\0' ? _(" --language=") : ""), +- get_resource_id_quoted(lang_wr), ++ lang_quoted, + (type != NULL ? "type=" : ""), + (type != NULL ? type : ""), + (type != NULL ? " " : ""), + (uint32_t) (offset - fi->memory), size); ++ free(type_quoted); ++ free(name_quoted); ++ free(lang_quoted); + } + + /* return the resource id quoted if it's a string, otherwise just return it */ + static char * + get_resource_id_quoted (WinResource *wr) + { +- static char tmp[WINRES_ID_MAXLEN+2]; +- + if (wr->numeric_id || wr->id[0] == '\0') +- return wr->id; ++ return xstrdup(wr->id); + +- sprintf(tmp, "'%s'", wr->id); +- return tmp; ++ return xasprintf("'%s'", wr->id); + } + + static bool +-- +2.13.2 + + diff --git a/README.en.md b/README.en.md deleted file mode 100644 index fbcb611..0000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# icoutils - -#### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md index 86f9fae..2e3e5a8 100644 --- a/README.md +++ b/README.md @@ -1,39 +1 @@ # icoutils - -#### 介绍 -{**以下是码云平台说明,您可以替换此简介** -码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 码云特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 -5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/icoutils-0.32.3.tar.bz2 b/icoutils-0.32.3.tar.bz2 new file mode 100644 index 0000000..2407c9f Binary files /dev/null and b/icoutils-0.32.3.tar.bz2 differ diff --git a/icoutils.spec b/icoutils.spec new file mode 100644 index 0000000..f639853 --- /dev/null +++ b/icoutils.spec @@ -0,0 +1,54 @@ +Name: icoutils +Version: 0.32.3 +Release: 4 +Summary: extract and convert Microsoft icon and cursor files + +License: GPLv3+ +URL: http://www.nongnu.org/icoutils/ +Source0: http://nongnu.askapache.com/%{name}/%{name}-%{version}.tar.bz2 + +# Possible security fix, at minimum it's a DoS. +# Upstream commit d72956a6de228c91d1fc48fd15448fadea9ab6cf +Patch1: 0001-wrestool-Fix-get_resource_id_quoted-to-return-heap-a.patch + +BuildRequires: autoconf automake gcc gettext libpng-devel perl-generators + +Provides: bundled(gnulib) + +%description +The icoutils are a set of command-line programs for extracting and converting images +in Microsoft Windows(R) icon and cursor files. These files usually have the extension +.ico or .cur, but they can also be embedded in executables and libraries (.dll-files). + +%prep +%autosetup -p1 + +autoreconf -i + +for f in AUTHORS NEWS; do + iconv -f ISO88592 -t UTF8 < $f > $f.utf8 && \ + touch -r $f $f.utf8 && \ + mv $f.utf8 $f +done + +%build +%configure +%make_build + +%install +%make_install +%find_lang %{name} + + +%files -f %{name}.lang +%doc README AUTHORS COPYING NEWS TODO ChangeLog +%{_bindir}/extresso +%{_bindir}/genresscript +%{_bindir}/icotool +%{_bindir}/wrestool +%{_mandir}/man1/*.1* + + +%changelog +* Wed Feb 12 2020 openEuler Buildteam - 0.32.3-4 +- Package init