Bug 427271

Summary: Crash in Seexpr library in printf() when evaluating a script
Product: [Frameworks and Libraries] SeExpr Reporter: Tiar <tamtamy.tymona>
Component: GeneralAssignee: amyspark <amy>
Status: RESOLVED FIXED    
Severity: crash CC: halla
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Mint (Ubuntu based)   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Crash log (from an appimage)

Description Tiar 2020-10-02 23:44:50 UTC
Created attachment 132078 [details]
Crash log (from an appimage)

SUMMARY
I got a crash in SeExpr while trying out printf() function.


STEPS TO REPRODUCE
1. Create a new document with SeExpr fill layer.
2. Paste: `$a = 5; $b = printf("a = %f", $a);`
3. Move cursor to just after %f, before the closing of the parenthesis.
4. Write ` %` and wait.

OBSERVED RESULT
Crash

EXPECTED RESULT
No crash :)

Krita

 Version: 4.4.0-beta2
 Languages: en_US, en, en_US, en, en_US, en, pl_PL, pl, pl_PL, pl
 Hidpi: true

Qt

  Version (compiled): 5.12.9
  Version (loaded): 5.12.9

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 5.3.7-050307-generic
  Pretty Productname: Linux Mint 19.3
  Product Type: linuxmint
  Product Version: 19.3
  Desktop: X-Cinnamon
Comment 1 Tiar 2020-10-02 23:45:20 UTC
Assigning to amyspark.
Comment 2 amyspark 2020-10-03 22:39:32 UTC
Git commit a77cbfd7ea288c926007e09073cf7bccff4f5906 by L. E. Segovia.
Committed on 03/10/2020 at 17:14.
Pushed by lsegovia into branch 'master'.

Fix printf format validation

M  +6    -0    src/SeExpr2/ErrorCode.h
M  +44   -6    src/SeExpr2/ExprBuiltins.cpp
M  +7    -1    src/SeExpr2/UI/ErrorMessages.cpp
M  +13   -1    src/demos/imageEditor/imageEditor.cpp

https://invent.kde.org/graphics/seexpr/commit/a77cbfd7ea288c926007e09073cf7bccff4f5906