Bug 486134

Summary: Crash when opening an IFF data (?) file
Product: [Applications] kate Reporter: Jonas Baecker <vlu2at1ax>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: christoph, info, unwxcyciqqqlosshuo
Priority: NOR    
Version First Reported In: 24.02.2   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Process 8633 (kate) of user 1000 dumped core.
An example of a file that's causing the crash

Description Jonas Baecker 2024-04-25 22:10:25 UTC
Created attachment 168908 [details]
Process 8633 (kate) of user 1000 dumped core.

SUMMARY
Kate will crash immediately when opening the file. Note that this file is not actually meant to be readable by Kate, but Dolphin identified it as a text file for me so I tried opening it. The "file" command identifies the file as an IFF file, it's from an old video game "Urban Assault". All the *.BAS files that come with this game seem to cause a crash, I have uploaded one that has a small filesize for testing.


STEPS TO REPRODUCE
1. Try opening the file "xc.BAS"
2. Kate should crash

OBSERVED RESULT
Kate crashing.

EXPECTED RESULT
Kate not crashing and perhaps showing a warning that the file is not a text file.

SOFTWARE/OS VERSIONS
Linux: 6.8.6
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Comment 1 Jonas Baecker 2024-04-25 22:11:16 UTC
Created attachment 168909 [details]
An example of a file that's causing the crash
Comment 2 Christoph Cullmann 2024-04-27 18:42:20 UTC
Git commit 990d5a34a699b61bbf321b4081afc9deb2f00f9b by Christoph Cullmann.
Committed on 27/04/2024 at 18:42.
Pushed by cullmann into branch 'master'.

fix crashs and OOM on load with encoding failures
Related: bug 486195

M  +51   -0    autotests/src/katetextbuffertest.cpp
M  +1    -0    src/buffer/katetextloader.h

https://invent.kde.org/frameworks/ktexteditor/-/commit/990d5a34a699b61bbf321b4081afc9deb2f00f9b
Comment 3 Christoph Cullmann 2024-04-27 18:44:55 UTC
Thanks for the report, was easy to reproduce, fixed and added some test to avoid regressions.
Comment 4 Christoph Cullmann 2024-05-05 17:24:39 UTC
*** Bug 486623 has been marked as a duplicate of this bug. ***
Comment 5 Christoph Cullmann 2024-05-08 11:39:03 UTC
*** Bug 486762 has been marked as a duplicate of this bug. ***