Bug 444162

Summary: Stack overflow on recursive JavaScript structures
Product: [Applications] okteta Reporter: Nagy Tibor <xnagytibor>
Component: Structures ToolAssignee: Alex Richardson <arichardson.kde>
Status: REPORTED ---    
Severity: normal CC: kossebau
Priority: NOR    
Version First Reported In: 0.26.6   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Backtrace

Description Nagy Tibor 2021-10-21 01:43:46 UTC
Created attachment 142700 [details]
Backtrace

SUMMARY
When defining the following recursive JavaScript structure Okteta crashes with a stack overflow. I don't remember anymore what I originally wanted to achieve by writing a cursed structure like this, this script has been sitting on my machine for years.

STEPS TO REPRODUCE

function init() {
    var x = struct({});
    x.fields["X"] = array(x, 0);
    return x;
}

EXPECTED RESULT
Fail gracefully on trying to execute this script.

OBSERVED RESULT
After enabling this structure Okteta immediately crashes with a stack overflow. You won't be able to bring up Okteta's GUI anymore to disable this script, oktetastructuresrc must be edited manually to disable it. Could be used to annoy people through Get Hot New Stuff.

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.23
KDE Plasma Version: 5.23.1
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.3