On Fri, May 26, 2017 at 09:59:44AM +0200, Harald van Dijk wrote: > Hi, > > On 26/05/17 09:04, Youfu Zhang wrote: > > $ PATH=/extra/path:/usr/sbin:/usr/bin:/sbin:/bin \ > >> sh -xc 'command -V ls; command -V ls; command -Vp ls; command -vp ls' > > + command -V ls > > ls is /bin/ls > > + command -V ls > > ls is a tracked alias for /bin/ls > > + command -Vp ls > > ls is a tracked alias for (null) > > + command -vp ls > > Segmentation fault (core dumped) > > > > describe_command should respect `path' argument. Looking up in the hash table > > may gives incorrect index in entry.u.index and finally causes incorrect output > > or SIGSEGV. > > True, but only when a path is passed in. If the default path is used, > looking up in the hash table is correct, and printing tracked aliases is > intentional. > > If it's desirable to drop that feature, then it should be dropped > completely, code shouldn't be left in that can no longer be used. But > it's possible to keep it working: how about this instead? > > Signed-off-by: Harald van Dijk <harald@xxxxxxxxxxx> Patch applied. Thanks. -- Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line "unsubscribe dash" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html