bugGNU nano - Bugs: bug #60658, "undefined behavior"...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #60658: "undefined behavior" when searching backwards

Submitter:  Benno Schulenberg <bens>
Submitted:  Sun 23 May 2021 09:45:32 AM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Mon 24 May 2021 09:04:42 AM UTC, comment #2: 

Another "undefined behavior" happened when I searched backward case-sensitively.  :|  I forgot to check wehther there were more occurrences of 'tail_len - needle_len'.  Fixed now in git, commit 30bafc70.

Benno Schulenberg <bens>
Group administrator
Sun 23 May 2021 09:51:31 AM UTC, comment #1: 

Fixed in git, commit ceaae49b, by reversing the subtraction, as at that point 'needle_len' is always bigger than 'tail_len'.

Benno Schulenberg <bens>
Group administrator
Sun 23 May 2021 09:45:32 AM UTC, original submission:  

To reproduce, configure nano with "-O0 -fsanitize=undefined" in your CFLAGS, compile, and then run:

src/nano --ignore NEWS 2>TRAIL; cat TRAIL

Then type: ^Q what <Enter> ^X
Result:

chars.c:543:12: runtime error: addition of unsigned offset to 0x602000002930 overflowed to 0x60200000292c
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior chars.c:543:12 in

Benno Schulenberg <bens>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-06-16 bens Open/ClosedOpen Closed
    2021-05-23 bens StatusNone Fixed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code