Menu

#565 Using a cluster for string comparison overwrites its contents

v1.1.x
fixed
None
v1.1.2
Bug Fix
2021-03-22
2021-03-05
Erik Hänel
No

If a cluster is used for string comparison like this

c{} == ""

then it's contents are overwritten by the result of the comparison (i.e. 1 or 0).

Analysis:

The issue is located in the first condition of isClusterCandidate(), which looks for an assignment operator but does not validate that it isn't a boolean comparison operator. It might be a good solution to unify all occurences of assignment operator searches into a common functionality.

Implementation:

  • Implementation: Implemented as proposed by the analysis.
  • Revision: [r838]
  • Implementation test: Erroneous expression was tested and it returned the correct results.

Documentation:

  • [x] ChangesLog updated
  • [x] Code changes commented
  • Documentation articles:
    • [ ] corresponding documentation articles updated
    • [ ] new documentation articles created
    • [x] not needed
  • Language files:
    • [ ] corresponding language files updated
    • [x] not needed

Tests:

Added to the automatic SW tests. Tests ran without deviation.

Related

Commit: [r838]

Discussion

  • Erik Hänel

    Erik Hänel - 2021-03-05
    • status: open --> accepted
     
  • Erik Hänel

    Erik Hänel - 2021-03-05
    • summary: Using a cluster for string comparision overwrites its contents --> Using a cluster for string comparison overwrites its contents
     
  • Erik Hänel

    Erik Hänel - 2021-03-05
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -3,3 +3,25 @@
         c{} == ""
    
     then it's contents are overwritten by the result of the comparison (i.e. `1` or `0`).
    +
    +###Analysis:
    +(*Describe, what's the issue and which changes have to be made*)
    +
    +###Implementation:
    +* Implementation: (*Describe, what you've changed*) 
    +* Revision: [rXXX]
    +* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +
    +###Documentation:
    +* [ ] ChangesLog updated
    +* [ ] Code changes commented
    +* **Documentation articles:**
    
    +    * [ ] corresponding documentation articles updated
    +    * [ ] new documentation articles created
    +    * [ ] not needed
    +* **Language files:**
    +    * [ ] corresponding language files updated
    +    * [ ] not needed
    +
    +###Tests:
    +(*Describe, which tests you performed and their outcome*)
    
    • status: accepted --> analyzing
     
  • Erik Hänel

    Erik Hänel - 2021-03-05
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -5,7 +5,7 @@
     then it's contents are overwritten by the result of the comparison (i.e. `1` or `0`).
    
     ###Analysis:
    -(*Describe, what's the issue and which changes have to be made*)
    +The issue is located in the first condition of `isClusterCandidate()`, which looks for an assignment operator but does not validate that it isn't a boolean comparison operator. It might be a good solution to unify all occurences of assignment operator searches into a common functionality.
    
     ###Implementation:
    
     * Implementation: (*Describe, what you've changed*) 
    
    • status: analyzing --> implementing
     
  • Erik Hänel

    Erik Hänel - 2021-03-06
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -8,20 +8,20 @@
     The issue is located in the first condition of `isClusterCandidate()`, which looks for an assignment operator but does not validate that it isn't a boolean comparison operator. It might be a good solution to unify all occurences of assignment operator searches into a common functionality.
    
     ###Implementation:
    -* Implementation: (*Describe, what you've changed*) 
    -* Revision: [rXXX]
    -* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +* Implementation: Implemented as proposed by the analysis.
    +* Revision: [r838]
    +* Implementation test: Erroneous expression was tested and it returned the correct results.
    
     ###Documentation:
    -* [ ] ChangesLog updated
    -* [ ] Code changes commented
    +* [x] ChangesLog updated
    +* [x] Code changes commented
    
     * **Documentation articles:**
         * [ ] corresponding documentation articles updated
         * [ ] new documentation articles created
    -    * [ ] not needed
    +    * [x] not needed
     * **Language files:**
         * [ ] corresponding language files updated
    -    * [ ] not needed
    +    * [x] not needed
    
     ###Tests:
     (*Describe, which tests you performed and their outcome*)
    
    • status: implementing --> testing
     

    Related

    Commit: [r838]

  • Erik Hänel

    Erik Hänel - 2021-03-22
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -24,4 +24,4 @@
    
         * [x] not needed
    
     ###Tests:
    -(*Describe, which tests you performed and their outcome*)
    +Added to the automatic SW tests. Tests ran without deviation.
    
    • status: testing --> fixed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB