https://bugs.documentfoundation.org/show_bug.cgi?id=166673

            Bug ID: 166673
           Summary: BASIC: Calling Space(-1) succeeds in release version
                    (even in VBA support mode), crashes in debug version
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Keywords: difficultyBeginner, easyHack, skillCpp
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: [email protected]
          Reporter: [email protected]

This Basic code succeeds in release version:

 Space(-1)

In release version, this aborts because of failed assertion.

1. In VBA, this code gives Invalid Procedure Call run-time error (5).
We need to do the same in VBASupport mode.

2. We can't do that in non-VBA mode, because there is existing code relying on
current behavior. We need to sanitize the passed value instead, so that it
reaches the internals, where the "non-negative" preconditions must be met, in a
valid state.

Code pointer: SbRtl_Space in basic/source/runtime/methods.cxx.
The patch must contain unit tests both for non-VBA, and VBA support cases.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to