Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Covscan - Wrong Check of Return Value #96

Open
justin-stephenson opened this issue Apr 22, 2022 · 0 comments
Open

Covscan - Wrong Check of Return Value #96

justin-stephenson opened this issue Apr 22, 2022 · 0 comments

Comments

@justin-stephenson
Copy link
Collaborator

justin-stephenson commented Apr 22, 2022

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 justin-stephenson changed the title Covscan - Defect type: [NULL_RETURNS] Covscan - Wrong Check of Return Value Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant