MFH: r556844

Don't reassign the "len" variable and compute the exact spaces needed.

PR:		251275
Submitted by:	Romeo Rajomalaza <endian.sign _ gmail.com>
Reported by:	Romeo Rajomalaza <endian.sign _ gmail.com>
Approved by:	ports-secteam (fluffy)
This commit is contained in:
Cy Schubert 2020-12-03 04:22:51 +00:00
parent fc6103061c
commit 629c073869
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/branches/2020Q4/; revision=556884
2 changed files with 13 additions and 0 deletions

View File

@ -2,6 +2,7 @@
PORTNAME= ksh2020
PORTVERSION= 2020
PORTREVISION= 1
CATEGORIES= shells
MAINTAINER= cy@FreeBSD.org

View File

@ -0,0 +1,12 @@
--- src/cmd/ksh93/edit/pcomplete.c.orig 2020-11-20 14:41:10.427589000 +0000
+++ src/cmd/ksh93/edit/pcomplete.c 2020-11-20 14:47:28.958973000 +0000
@@ -338,8 +338,7 @@
}
if (complete) {
// Reserved space on stack and try again.
- len = 3;
- tlen = (c + 1) * sizeof(char *) + len * c + 1024;
+ tlen += (c + 1) * sizeof(char *) + (plen + slen + 1) * c;
stkseek(shp->stk, tlen);
complete = 2;
av = (char **)stkptr(shp->stk, 0);