Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Fix seg fault on user autocomplete under msys
- X-seq: zsh-workers 40935
- From: Orlov Sergey <orlov.home@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: Fix seg fault on user autocomplete under msys
- Date: Tue, 4 Apr 2017 22:43:47 +0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=wKwMdH/APgcBSV1697DtyjmpY/Hy8F2DR0dhfgvhk2A=; b=OgFX6d9MLNDb1buAQdbqBa14Vd8EYdJ3wCP5FrpUUiizaOiOg35v41YTu58XFqr6Dk akhvyK2v7bpdBy43ReLurc2QmSoDvz8nd0YzowWS8L65Sv+K9lwutOLm+jR2dNH53z3U nClypMVOG3nxnwDh006ztTuz4VqKCria6DD9bqHJJJwPyGLoOUPPIlqetS6xrR69uKzE qiTRan+QP7UoqGFONAVkZQsTsFpt70I2XBTMrc62HEiyNyVB9D4OBrB9t47skf5RXwur JqnStgCLtZoqIrRd22JPOW3X9o+hVN6xtVZ4ACEvFvZvFppBYq9FUi58wfkweREukfhU ktcw==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Under windows (MSYS2 or Cygwin) user names can contain local characters.
For example user name "СИСТЕМА" (RU_ru.utf-8). This leads to infinite loop
in function quotestring and char array overflow.
So user names need metafy.
diff --git a/Src/utils.c b/Src/utils.c index b3fa3d24c..0aeb85089 100644
--- a/Src/utils.c +++ b/Src/utils.c @@ -1230,13 +1230,13 @@ adduserdir(char
*s, char *t, int flags, int always) * named directory, since these are
sometimes used for * special purposes. */ - nd->dir = ztrdup(t); + nd->dir
= metafy(t, -1, META_DUP); } else - nd->dir = ztrduppfx(t, eptr - t); +
nd->dir = metafy(t, eptr - t , META_DUP); /* The variables PWD and OLDPWD
are not to be displayed as ~PWD etc. */ if (!strcmp(s, "PWD") || !strcmp(s,
"OLDPWD")) nd->node.flags |= ND_NOABBREV; -
nameddirtab->addnode(nameddirtab, ztrdup(s), nd); +
nameddirtab->addnode(nameddirtab, metafy(s, -1, META_DUP), nd); } /* Get a
named directory: this function can cause a directory name *
Messages sorted by:
Reverse Date,
Date,
Thread,
Author