bugGNU nano - Bugs: bug #57972, invalid read/write when justified...

 
 

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

bug #57972: invalid read/write when justified region starts with whitespace

Submitter:  Benno Schulenberg <bens>
Submitted:  Sun 08 Mar 2020 01:58:26 PM UTC
   
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Sun 08 Mar 2020 02:16:01 PM UTC, comment #1: 

Fixed in git, commit d6beca5d.

Benno Schulenberg <bens>
Group administrator
Sun 08 Mar 2020 01:58:26 PM UTC, original submission:  

To reproduce, run 'src/nano --ignore +11,36 README'.
Then type: <Ctrl+Shift+Down> ^J

When running that recipe inside valgrind, the result contains four items like this:

==6029== Invalid read of size 2
==6029==    at 0x4C340DF: memcpy@GLIBC_2.2.5 (in /usr/lib/valgrind/vgpreload_memcheck-amd>
==6029==    by 0x12A65A: memmove (string_fortified.h:40)
==6029==    by 0x12A65A: do_justify (text.c:2083)
==6029==    by 0x12A7D1: do_justify_void (text.c:2199)
==6029==    by 0x11EC06: do_input (nano.c:1627)
==6029==    by 0x120157: main (nano.c:2611)
==6029==  Address 0x592e824 is 36 bytes inside a block of size 37 alloc'd
==6029==    at 0x4C31D2F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6029==    by 0x12CDE4: nrealloc (utils.c:307)
==6029==    by 0x12A5E4: do_justify (text.c:2067)
==6029==    by 0x12A7D1: do_justify_void (text.c:2199)
==6029==    by 0x11EC06: do_input (nano.c:1627)
==6029==    by 0x120157: main (nano.c:2611)

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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-03-25 bens Open/ClosedOpen Closed
    2020-03-08 bens StatusNone Fixed
        Summarywhen justified region starts with whitespace, valgrind reports invalid read/write invalid read/write when justified region starts with whitespace

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code