Opened 4 years ago

Closed 4 years ago

#900 closed defect (fixed)

opening binary files may crash Padre

Reported by: zenogantner Owned by:
Priority: major Milestone:
Component: editor Version: trunk
Keywords: crash Cc:

Description

When I open a binary file, say include/locale/de.mo, Padre crashes.

Malformed UTF-8 character (byte 0xfe) in pattern match (m) at /mnt/data/src/padre/Padre/lib/Padre/MimeTypes.pm line 667.
Malformed UTF-8 character (unexpected continuation byte 0x83, with no preceding start byte) in pattern match (m
) at /mnt/data/src/padre/Padre/lib/Padre/MimeTypes.pm line 667.
Malformed UTF-8 character (unexpected continuation byte 0x83, with no preceding start byte) in pattern match (m) at /mnt/data/src/padre/Padre/lib/Padre/MimeTypes.pm line 667.
Malformed UTF-8 character (unexpected continuation byte 0xaf, with no preceding start byte) in pattern match (m
) at /mnt/data/src/padre/Padre/lib/Padre/MimeTypes.pm line 667.
Malformed UTF-8 character (unexpected continuation byte 0x87, with no preceding start byte) in pattern match (m) at /mnt/data/src/padre/Padre/lib/Padre/MimeTypes.pm line 667.
Malformed UTF-8 character (unexpected continuation byte 0x88, with no preceding start byte) in pattern match (m
) at /mnt/data/src/padre/Padre/lib/Padre/MimeTypes.pm line 667.
Malformed UTF-8 character (unexpected continuation byte 0xa0, with no preceding start byte) in pattern match (m) at /mnt/data/src/padre/Padre/lib/Padre/MimeTypes.pm line 667.
Malformed UTF-8 character (fatal) at /mnt/data/src/padre/Padre/lib/Padre/MimeTypes.pm line 684.

Padre should catch such errors and handle them gracefully, e.g. by refusing to load the file (and explaining that to the user).
Gedit (the GNOME editor) does that.

Padre r11141
Wx Version=(0.9701) wxWidgets 2.8.10 unicode=(1)
v5.10.0 built for i486-linux-gnu-thread-multi

Change History (1)

comment:1 Changed 4 years ago by zenogantner

  • Resolution set to fixed
  • Status changed from new to closed

I think this is fixed for the most part in r11288.
The output above is still there, but no crash any more.

I have added a test case (the first 20 bytes of de.mo) to the test suite.

Note: See TracTickets for help on using tickets.