kilo icon indicating copy to clipboard operation
kilo copied to clipboard

"\t//" crashes kilo (sometimes!)

Open 1-p opened this issue 7 years ago • 4 comments

to reproduce, start a new line, hit TAB, then / twice.

or hit / twice and then TAB at the beginning of the line.

Segmentation fault: 11

Seems like the while(*p) loop in editorUpdateSyntax has some bug.

https://github.com/antirez/kilo/blob/master/kilo.c#L401

1-p avatar Jul 12 '16 02:07 1-p

@1-p Thanks for reporting! :-) Are you able to reproduce this? What platform are you using?

I'm unable to reproduce. I've tested under both Linux and OS X.

practicalswift avatar Jul 12 '16 20:07 practicalswift

I was able to reproduce it (Linux, Elementary OS). The PR solves it though.

Ruk33 avatar Jul 12 '16 21:07 Ruk33

It is reproducing for me too. OS X. Always.

Alykoff avatar Jul 12 '16 22:07 Alykoff

@practicalswift Well, do it in a new line and enter \t//

It's due to a negative memset argument, as I said. And the PR I submitted fixed it. (changed a single char)

1-p avatar Jul 16 '16 01:07 1-p