Siteshwar Vashisht
2017-01-04 12:16:42 UTC
Hello,
There is a bug in sh_eval() function that may cause ksh to crash due to double free() after sourcing multiple files. I am providing a patch to fix this bug.
function f1
{
echo "f1"
}
function f2
{
if [[ $1 -eq 1 ]]: then
echo "f2"
fi
}
function f3
{
[[ 1 = 1 ]] && set -x
}
. ./functions.ksh
echo "sub1" > ./tmp.out
. ./sub1.ksh
Segmentation fault (core dumped)
There is a bug in sh_eval() function that may cause ksh to crash due to double free() after sourcing multiple files. I am providing a patch to fix this bug.
cat functions.ksh
#!/bin/kshfunction f1
{
echo "f1"
}
function f2
{
if [[ $1 -eq 1 ]]: then
echo "f2"
fi
}
function f3
{
[[ 1 = 1 ]] && set -x
}
cat sub1.ksh
#!/bin/ksh. ./functions.ksh
echo "sub1" > ./tmp.out
cat main.ksh
#!/bin/ksh. ./sub1.ksh
ksh main.ksh
main.ksh[2]: .[3]: .: syntax error at line 10: `]]:' unexpectedSegmentation fault (core dumped)
--
--
Siteshwar Vashisht
--
Siteshwar Vashisht