Skip to content

Conversation

@bwikbs
Copy link
Member

@bwikbs bwikbs commented Oct 23, 2021

Resolve #192

* Improper use of negative value

Signed-off-by: MuHong Byun <mh.byun@samsung.com>
* Uninitialized scalar field

Signed-off-by: MuHong Byun <mh.byun@samsung.com>
* Logically dead code

Signed-off-by: MuHong Byun <mh.byun@samsung.com>
* Uninitialized pointer field

Signed-off-by: MuHong Byun <mh.byun@samsung.com>
@bwikbs bwikbs marked this pull request as ready for review October 23, 2021 12:35
: -1;

if (composing_base_value == -1 && composing_extent_value == -1) {
if (composing_base_value < 0 || composing_extent_value < 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two are logically different. Did you mean

Suggested change
if (composing_base_value < 0 || composing_extent_value < 0) {
if (composing_base_value < 0 && composing_extent_value < 0) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I tried to change this.
Maybe @bbrto21 can give an opinion regarding this.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a problem that the static analysis tool is a problem.
image
As you see, flutter::TextRange receives size_t as an argument. The negative number can be able to produce unwanted results.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, we have to cast a type from int to size_t when using TextRange constructor

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌 It looks good in point of consistency with other platforms.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bbrto21 Hmm. Isn't it still unsafe if one of composing_base_value and composing_extent_value has a non-negative value and the other has a negative value?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theoretically it is correct.. All other ports are set like this, so it will not happen in practice area. I guess..

Signed-off-by: MuHong Byun <mh.byun@samsung.com>
@swift-kim swift-kim changed the title Fix coverity Issue Fix coverity issues Oct 27, 2021
@swift-kim swift-kim merged commit 8d08f2a into flutter-tizen:flutter-2.5.1-tizen Oct 27, 2021
swift-kim pushed a commit that referenced this pull request Nov 14, 2021
* Fix static analysis issue (coverity)

* Improper use of negative value

Signed-off-by: MuHong Byun <mh.byun@samsung.com>

* Fix static analysis issue (coverity)

* Uninitialized scalar field

Signed-off-by: MuHong Byun <mh.byun@samsung.com>

* Fix static analysis issue (coverity)

* Logically dead code

Signed-off-by: MuHong Byun <mh.byun@samsung.com>

* Fix static analysis issue (coverity)

* Uninitialized pointer field

Signed-off-by: MuHong Byun <mh.byun@samsung.com>

* Apply review's comment

Signed-off-by: MuHong Byun <mh.byun@samsung.com>
swift-kim pushed a commit that referenced this pull request Dec 9, 2021
* Fix static analysis issue (coverity)

* Improper use of negative value

Signed-off-by: MuHong Byun <mh.byun@samsung.com>

* Fix static analysis issue (coverity)

* Uninitialized scalar field

Signed-off-by: MuHong Byun <mh.byun@samsung.com>

* Fix static analysis issue (coverity)

* Logically dead code

Signed-off-by: MuHong Byun <mh.byun@samsung.com>

* Fix static analysis issue (coverity)

* Uninitialized pointer field

Signed-off-by: MuHong Byun <mh.byun@samsung.com>

* Apply review's comment

Signed-off-by: MuHong Byun <mh.byun@samsung.com>
swift-kim pushed a commit that referenced this pull request Dec 17, 2021
* Fix static analysis issue (coverity)

* Improper use of negative value

* Uninitialized scalar field

* Logically dead code

* Uninitialized pointer field

* Apply review's comment

Signed-off-by: MuHong Byun <mh.byun@samsung.com>
swift-kim pushed a commit that referenced this pull request Feb 7, 2022
* Fix static analysis issue (coverity)

* Improper use of negative value

* Uninitialized scalar field

* Logically dead code

* Uninitialized pointer field

* Apply review's comment

Signed-off-by: MuHong Byun <mh.byun@samsung.com>
swift-kim pushed a commit that referenced this pull request Feb 11, 2022
* Fix static analysis issue (coverity)

* Improper use of negative value

* Uninitialized scalar field

* Logically dead code

* Uninitialized pointer field

* Apply review's comment

Signed-off-by: MuHong Byun <mh.byun@samsung.com>
swift-kim pushed a commit that referenced this pull request May 12, 2022
* Fix static analysis issue (coverity)

* Improper use of negative value

* Uninitialized scalar field

* Logically dead code

* Uninitialized pointer field

* Apply review's comment

Signed-off-by: MuHong Byun <mh.byun@samsung.com>
swift-kim pushed a commit that referenced this pull request Aug 5, 2022
* Fix static analysis issue (coverity)

* Improper use of negative value

* Uninitialized scalar field

* Logically dead code

* Uninitialized pointer field

Signed-off-by: MuHong Byun <mh.byun@samsung.com>
swift-kim pushed a commit that referenced this pull request Sep 1, 2022
* Fix static analysis issue (coverity)

* Improper use of negative value

* Uninitialized scalar field

* Logically dead code

* Uninitialized pointer field

Signed-off-by: MuHong Byun <mh.byun@samsung.com>
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

Successfully merging this pull request may close these issues.

Result of coverity scan at engine

3 participants