[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Segfault in Bash
From: |
Greg Wooledge |
Subject: |
Re: Segfault in Bash |
Date: |
Tue, 14 Jul 2020 08:23:20 -0400 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
> > IFS="" find "$dir" -name '*.so' -print | while read -r file
> > do
> > if ! $(echo "$file" | grep -E "*.so$"); then continue; fi
> > echo "library: $file"
> >
> > done
Also, I forgot to point out: your "if" line is executing each of
the shared libraries that you find. Every one of them matches the
grep check, and since you enclosed the check in a command substitution,
the output of grep (which is the pathname) is *executed* as a command.
That's probably where your segfault is happening.
Once you remove this completely unnecessary and incorrectly written
check, the segfaults from running random shared library files as
commands will stop happening.