justinmeza / lci

A LOLCODE interpreter written in C.
http://lolcode.org
GNU General Public License v3.0
784 stars 105 forks source link

SIGSEV #43

Open jD91mZM2 opened 7 years ago

jD91mZM2 commented 7 years ago

An unclosed OBTW result in a segmation fault.

initbar commented 7 years ago

Hi could you provide an example code (and perhaps environment)?

jD91mZM2 commented 7 years ago

To me it worked every time I had an unclosed statement, although I no longer have lolcode installed

initbar commented 7 years ago

@jD91mZM2 sorry for the late reply.

Nice catch ! I was also able to verify this bug and it's likely that the issue is from tokenization process of incrementing start index until TLDR token is found:

bug

Since TLDR is not in the string, it's just going to increment the index until it's greater than the total string length:

bug12

I'll create a PR but I think adding a constraint to the while statement would fix this issue.