jenkinsci / jenkinsci/script-security-plugin
[JENKINS-50869] Calling `empty` on Groovy list leads to a list being returned, not correct check
- Dominant language
- Java
- Stars
- 76
- Forks
- 181
- Avg merge
- 14h 55m
- Merged PRs (30d)
- 3
Description
Steps to reproduce:
- Create a freestyle job
- Add "Execute system Groovy script" build step
- Add content (see below)
- Run build with "Use Groovy Sandbox" enabled.
- Run without "Use Groovy Sandbox" enabled
def someArrayList = []println someArrayList.empty
This works when the sandbox is disabled, but when sandbox is enabled it returns
[]
Instead of
true
like it should.
After downgrading back from Script Security 1.44 to 1.43 the problem is fixed.
I suspect https://issues.jenkins-ci.org/browse/JENKINS-50470 is the problem
---
Originally reported by kylec_32, imported from: Calling `empty` on Groovy list leads to a list being returned, not correct check
Raw content of original issue
Steps to reproduce:
- Create a freestyle job
- Add "Execute system Groovy script" build step
- Add content (see below)
- Run build with "Use Groovy Sandbox" enabled.
- Run without "Use Groovy Sandbox" enabled
def someArrayList = []println someArrayList.empty
This works when the sandbox is disabled, but when sandbox is enabled it returns
[]Instead of
truelike it should.
After downgrading back from Script Security 1.44 to 1.43 the problem is fixed.
I suspect https://issues.jenkins-ci.org/browse/JENKINS-50470 is the problem
environment
```
Jenkins 2.117
Script Security 1.44
```
Contributor guide
Assessment
This issue has not been assessed yet.