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

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Sun 23 May 2021 09:45:32 AM UTC  
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  Benno Schulenberg <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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.

 

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)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    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.6