-
Notifications
You must be signed in to change notification settings - Fork 17
Fix coverity issues #196
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
Fix coverity issues #196
Conversation
* 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>
| : -1; | ||
|
|
||
| if (composing_base_value == -1 && composing_extent_value == -1) { | ||
| if (composing_base_value < 0 || composing_extent_value < 0) { |
There was a problem hiding this comment.
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
| if (composing_base_value < 0 || composing_extent_value < 0) { | |
| if (composing_base_value < 0 && composing_extent_value < 0) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain why you want to change it.
it corresponds to https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/services/text_input.dart#L765
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>

Resolve #192