cockpit-session-recording icon indicating copy to clipboard operation
cockpit-session-recording copied to clipboard

Covscan - Wrong Check of Return Value

Open justin-stephenson opened this issue 3 years ago • 0 comments

Wrong Check of Return Value Collapse

1. Defect type: [NULL_RETURNS]
1. cockpit-session-recording/dist/index.js:437307: returned_null: "this.getCoords" returns "null" or "undefined" (checked 3 out of 4 times).
2. cockpit-session-recording/dist/index.js:437307: var_assigned: Assigning "coords" to the "null" or "undefined" return value from "this.getCoords".
3. cockpit-session-recording/dist/index.js:437308: property_access: Accessing a property of null-like value "coords".
4. cockpit-session-recording/dist/index.js:437746: example_assign: Example 1: Assigning: "coords" = return value from "this._terminal.mouseHelper.getCoords(event, this._terminal.screenElement, this._charMeasure, this._terminal.cols, this._terminal.rows, true)".
5. cockpit-session-recording/dist/index.js:437747: example_checked: Example 1 (cont.): "coords" has its value checked in "coords".
6. cockpit-session-recording/dist/index.js:437480: example_assign: Example 2: Assigning: "coords" = return value from "this._terminal.mouseHelper.getCoords(e, this._terminal.screenElement, this._terminal.charMeasure, this._terminal.cols, this._terminal.rows)".
7. cockpit-session-recording/dist/index.js:437481: example_checked: Example 2 (cont.): "coords" has its value checked in "coords".
8. cockpit-session-recording/dist/index.js:441934: example_assign: Example 3: Assigning: "coordinates" = return value from "this._terminal.mouseHelper.getCoords(this._mouseEvent, this._terminal.element, this._terminal.charMeasure, this._terminal.cols, this._terminal.rows, false)".
9. cockpit-session-recording/dist/index.js:441935: example_checked: Example 3 (cont.): "coordinates" has its value checked in "coordinates".
# 437306|       MouseHelper.prototype.getRawByteCoords = function (event, element, charMeasure, colCount, rowCount) {
# 437307|           var coords = this.getCoords(event, element, charMeasure, colCount, rowCount);
# 437308|->         var x = coords[0];
# 437309|           var y = coords[1];
# 437310|           x += 32;

justin-stephenson avatar Apr 22 '22 13:04 justin-stephenson