Bug 164493 - ofz#385256118 Timeout on ImpEditEngine::InitScriptTypes
Summary: ofz#385256118 Timeout on ImpEditEngine::InitScriptTypes
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Jonathan Clark
URL:
Whiteboard: target:25.8.0
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-27 20:44 UTC by Caolán McNamara
Modified: 2025-01-07 19:43 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
test case (10.92 KB, application/octet-stream)
2024-12-27 20:44 UTC, Caolán McNamara
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Caolán McNamara 2024-12-27 20:44:29 UTC
Description:
certain input to ImpEditEngine::InitScriptTypes can result in never ending loop

Steps to Reproduce:
1. cp workdir/LinkTarget/Executable/fftester instdir/program
2. LD_LIBRARY_PATH=`pwd`/instdir/program gdb --args instdir/program/fftester ~/Downloads/clusterfuzz-testcase-minimized-schtmlfuzzer-5752938114383872 sc-html
3. run

Actual Results:
while (!pScriptScanner->AtEnd() || rTypes.empty())
   ...
   pScriptScanner->Advance();
   ...

never completes

Expected Results:
loop ends


Reproducible: Always


User Profile Reset: No

Additional Info:
Perhaps an issue since:

commit de29bec27e90a7d24a90c6f071e7899abefe683e
CommitDate: Thu Dec 19 18:18:30 2024 +0100

    tdf#163660 sw: Treat strong CJK inside RTL runs as Asian script
Comment 1 Caolán McNamara 2024-12-27 20:44:54 UTC
Created attachment 198298 [details]
test case
Comment 2 Caolán McNamara 2024-12-27 20:46:32 UTC
This is a little awkward to reproduce, but was detected in oss-fuzz yesterday
Comment 3 Commit Notification 2025-01-07 15:44:56 UTC
Jonathan Clark committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1afdda6bca508abe56edf7968677e689b5ee07d4

tdf#164493 Update script change algorithm to always make progress

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Caolán McNamara 2025-01-07 19:43:21 UTC
Thanks, appreciate it.