Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(577)

Issue 107730043: code review 107730043: acme: fix bufread crash due to typing-point scrolling (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 10 months ago by rsc
Modified:
9 years, 10 months ago
Reviewers:
CC:
rsc
Visibility:
Public.

Description

acme: fix bufread crash due to typing-point scrolling Acme tracks the most recent typing insertion point and the home and end keys stop there on their way up to the top or down to the bottom of the file. That point should be iq1, and it should be adjusted properly so that it's always between 0 and t->file->b.nc inclusive. (This is all code from an external contributor, years old at this point but new since Plan 9.) Somehow, sometimes iq1 ends up a little beyond b.nc, and when passed to textbacknl it crashes acme in bufread. I can't see how that can happen but if it does, avoid the crash. It's tempting to pull the insertion point code out entirely but this is a little less invasive and should fix things for now.

Patch Set 1 #

Patch Set 2 : diff -r f61195d7dce0 https://code.google.com/p/plan9port #

Patch Set 3 : diff -r f61195d7dce0 https://code.google.com/p/plan9port #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -0 lines) Patch
M src/cmd/acme/text.c View 1 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 2
rsc
Hello rsc, I'd like you to review this change to https://code.google.com/p/plan9port
9 years, 10 months ago (2014-06-03 04:16:35 UTC) #1
rsc
9 years, 10 months ago (2014-06-03 04:16:42 UTC) #2
*** Submitted as
https://code.google.com/p/plan9port/source/detail?r=a36fd96451f6 ***

acme: fix bufread crash due to typing-point scrolling

Acme tracks the most recent typing insertion point and
the home and end keys stop there on their way
up to the top or down to the bottom of the file.
That point should be iq1, and it should be adjusted
properly so that it's always between 0 and t->file->b.nc inclusive.
(This is all code from an external contributor, years old at this
point but new since Plan 9.)

Somehow, sometimes iq1 ends up a little beyond b.nc,
and when passed to textbacknl it crashes acme in bufread.
I can't see how that can happen but if it does, avoid the crash.

It's tempting to pull the insertion point code out entirely
but this is a little less invasive and should fix things for now.

TBR=rsc
https://codereview.appspot.com/107730043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b