Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: Crash bug on garbage input (previously reported to Debian)



On Sat, 14 Feb 2015 10:25:34 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> Garbage input (nul bytes, etc.) can cause the newly-introduced $(...)
> parser to become confused during look-ahead and back up the input too
> far before attempting a different parse.
> 
> The patch below simply detects the problem and turns it into a parse
> error with an appropriate warning.  It might be helpful to figure out
> how the confusion originates but this prevents the crash.

Hmmm... backup characters are simply matched with input characters.
Could it be something to do with multibyte?  If it's just invalid
characters, your fix is probably good enough in practice.  If it's a
problem with real multibyte characters we need to do more.e can

(I suspect we can do better with the jungle of input and history
character reading, which is a bit of a mess, though that's not really
relevant to the problem since I don't think the mess is causing any
problems in character counting.)

pws



Messages sorted by: Reverse Date, Date, Thread, Author