mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-02 22:11:54 +02:00
25898: avoid dereference of p after it is freed in getmathfunc.
This commit is contained in:
parent
4622e326bd
commit
d6c692599f
2 changed files with 5 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
|||
2008-10-14 Clint Adams <clint@zsh.org>
|
||||
|
||||
* 25898: Src/module.c: avoid dereference of p after it is freed
|
||||
in getmathfunc.
|
||||
|
||||
* 25897: Src/Zle/computil.c: remove small bit of dead code in
|
||||
cfp_opt_pats.
|
||||
|
||||
|
|
|
@ -1266,10 +1266,11 @@ getmathfunc(const char *name, int autol)
|
|||
if (!strcmp(name, p->name)) {
|
||||
if (autol && p->module && !(p->flags & MFF_USERFUNC)) {
|
||||
char *n = dupstring(p->module);
|
||||
int flags = p->flags;
|
||||
|
||||
removemathfunc(q, p);
|
||||
|
||||
(void)ensurefeature(n, "f:", (p->flags & MFF_AUTOALL) ? NULL :
|
||||
(void)ensurefeature(n, "f:", (flags & MFF_AUTOALL) ? NULL :
|
||||
name);
|
||||
|
||||
return getmathfunc(name, 0);
|
||||
|
|
Loading…
Reference in a new issue