- Fix license to be MIT, zsh seems to be using the "Modern" variant

of the license text.
- Import git commits 74eed99c312de05e19b54ba6b5d37a0aeb4ba713 and
  724fd07a67f135c74eba57e9f25fd342201ec722
  * metafy() added null termination even if buffer was not modifiable
  * Fix uninitialised memory after lexer realloc

OBS-URL: https://build.opensuse.org/package/show/shells/zsh?expand=0&rev=87
This commit is contained in:
Ismail Dönmez 2011-12-05 09:43:11 +00:00 committed by Git OBS Bridge
parent df01f973e2
commit d4737238b5
4 changed files with 81 additions and 1 deletions

View File

@ -0,0 +1,35 @@
commit 724fd07a67f135c74eba57e9f25fd342201ec722
Author: Peter Stephenson <pws@users.sourceforge.net>
Date: Sat Dec 3 17:24:45 2011 +0000
29934: Stef van Vlierberghe: uninitialised memory after lexer realloc
diff --git a/Src/lex.c b/Src/lex.c
index 90c4eff..05f54f8 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -567,22 +567,14 @@ add(int c)
{
*bptr++ = c;
if (bsiz == ++len) {
-#if 0
- int newbsiz;
-
- newbsiz = bsiz * 8;
- while (newbsiz < inbufct)
- newbsiz *= 2;
- bptr = len + (tokstr = (char *)hrealloc(tokstr, bsiz, newbsiz));
- bsiz = newbsiz;
-#endif
-
int newbsiz = bsiz * 2;
if (newbsiz > inbufct && inbufct > bsiz)
newbsiz = inbufct;
bptr = len + (tokstr = (char *)hrealloc(tokstr, bsiz, newbsiz));
+ /* len == bsiz, so bptr is at the start of newly allocated memory */
+ memset(bptr, 0, newbsiz - bsiz);
bsiz = newbsiz;
}
}

View File

@ -0,0 +1,29 @@
commit 74eed99c312de05e19b54ba6b5d37a0aeb4ba713
Author: Peter Stephenson <pws@users.sourceforge.net>
Date: Sat Dec 3 23:15:37 2011 +0000
29940: metafy() added null termination even if buffer was not modifiable
diff --git a/Src/utils.c b/Src/utils.c
index 6c2ea98..014cb2f 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -3959,7 +3959,7 @@ metafy(char *buf, int len, int heap)
if (imeta(*e++))
meta++;
- if (meta || heap == META_DUP || heap == META_HEAPDUP) {
+ if (meta || heap == META_DUP || heap == META_HEAPDUP || *e != '\0') {
switch (heap) {
case META_REALLOC:
buf = zrealloc(buf, len + meta + 1);
@@ -4002,8 +4002,8 @@ metafy(char *buf, int len, int heap)
meta--;
}
}
+ *e = '\0';
}
- *e = '\0';
return buf;
}

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Mon Dec 5 09:40:23 UTC 2011 - idoenmez@suse.de
- Fix license to be MIT, zsh seems to be using the "Modern" variant
of the license text.
- Import git commits 74eed99c312de05e19b54ba6b5d37a0aeb4ba713 and
724fd07a67f135c74eba57e9f25fd342201ec722
* metafy() added null termination even if buffer was not modifiable
* Fix uninitialised memory after lexer realloc
-------------------------------------------------------------------
Wed Nov 30 21:49:26 UTC 2011 - idoenmez@suse.de

View File

@ -20,7 +20,7 @@
Name: zsh
Version: 4.3.13
Release: 4
License: BSD
License: MIT
Summary: Shell with comprehensive completion
Url: http://www.zsh.org
%if 0%{?suse_version}
@ -42,6 +42,9 @@ Source16: dotzshrc.rh
Source17: zshprompt.pl
%endif
Patch1: %{name}-4.3.12-disable-c02cond-test.patch
# Fixes from zsh.git
Patch100: 724fd07a67f135c74eba57e9f25fd342201ec722.patch
Patch101: 74eed99c312de05e19b54ba6b5d37a0aeb4ba713.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version}
Requires(pre): %{install_info_prereq}
@ -96,6 +99,8 @@ This package contains the Zsh manual in html format.
%prep
%setup -q -n %{name}-%{version}
%patch1
%patch100 -p1
%patch101 -p1
# Remove executable bit
chmod 0644 Etc/changelog2html.pl