Skip to content
Snippets Groups Projects
Commit 305eedc2 authored by deuce's avatar deuce
Browse files

Watch for overwriting the end of linebuf in word_wrap and munge the line

in case of emergency.
parent 61e4be67
No related branches found
No related tags found
No related merge requests found
......@@ -785,6 +785,11 @@ js_word_wrap(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
old_prefix_bytes=prefix_bytes;
}
for(; inbuf[i]; i++) {
if(l>=len*2+2) {
l-=4;
linebuf[l]=0;
lprintf(LOG_CRIT, "Word wrap line buffer exceeded... munging line %s",linebuf);
}
switch(inbuf[i]) {
case '\r':
crcount++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment