1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 19:52:20 +00:00

Fix memory corruption while parsing functions

Discussion: https://bugzilla.redhat.com/show_bug.cgi?id=1451057

src/cmd/ksh93/sh/parse.c: funct():
- Make the savstak variable volatile and always initialise it to
  avoid undefined behaviour.

(cherry picked from commit 5e56b28cd63ec2120c5f70a6e0abf2f8dbb7e7dc)
This commit is contained in:
Martijn Dekker 2020-06-07 20:41:04 +02:00
parent b9f28bc508
commit 98c1e37d86

View file

@ -742,7 +742,7 @@ static Shnode_t *funct(Lex_t *lexp)
register Shnode_t *t;
register int flag;
struct slnod *volatile slp=0;
Stak_t *savstak;
Stak_t *volatile savstak=0;
Sfoff_t first, last;
struct functnod *volatile fp;
Sfio_t *iop;