Fix the ${foo:0:} crash
ok ajacoutot@, jasper@
This commit is contained in:
parent
cae9a5e207
commit
1df7aa6506
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.60 2011/02/03 08:56:14 pea Exp $
|
||||
# $OpenBSD: Makefile,v 1.61 2011/03/04 10:08:59 pea Exp $
|
||||
|
||||
COMMENT= Z shell, Bourne shell-compatible
|
||||
|
||||
@ -6,7 +6,7 @@ V= 4.3.11
|
||||
DISTNAME= zsh-$V
|
||||
CATEGORIES= shells
|
||||
|
||||
REVISION= 1
|
||||
REVISION= 2
|
||||
|
||||
MAINTAINER= Pierre-Emmanuel Andre <pea@openbsd.org>
|
||||
|
||||
|
27
shells/zsh/patches/patch-Src_subst_c
Normal file
27
shells/zsh/patches/patch-Src_subst_c
Normal file
@ -0,0 +1,27 @@
|
||||
$OpenBSD: patch-Src_subst_c,v 1.1 2011/03/04 10:08:59 pea Exp $
|
||||
|
||||
Fix for ${foo:0:} crash
|
||||
|
||||
--- Src/subst.c.orig Thu Dec 16 10:26:50 2010
|
||||
+++ Src/subst.c Thu Mar 3 15:14:28 2011
|
||||
@@ -2814,12 +2814,14 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt,
|
||||
zerr("invalid length: %s", check_offset);
|
||||
return NULL;
|
||||
}
|
||||
- length = mathevali(check_offset);
|
||||
- if (errflag)
|
||||
- return NULL;
|
||||
- if (length < (zlong)0) {
|
||||
- zerr("invalid length: %s", check_offset);
|
||||
- return NULL;
|
||||
+ if (check_offset) {
|
||||
+ length = mathevali(check_offset);
|
||||
+ if (errflag)
|
||||
+ return NULL;
|
||||
+ if (length < (zlong)0) {
|
||||
+ zerr("invalid length: %s", check_offset);
|
||||
+ return NULL;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
if (horrible_offset_hack) {
|
Loading…
x
Reference in New Issue
Block a user