github-advanced-security[bot] commented on code in PR #812:
URL: https://github.com/apache/datasketches-java/pull/812#discussion_r4646938438
##########
src/main/java/org/apache/datasketches/tuple/CompactTupleSketch.java:
##########
@@ -78,8 +82,60 @@
super(thetaLong, empty, null, seedHash);
super.thetaLong_ = thetaLong;
super.empty_ = empty;
- hashArr_ = hashArr;
- summaryArr_ = summaryArr;
+ if ((hashArr == null) || isSorted(hashArr)) {
+ hashArr_ = hashArr;
+ summaryArr_ = summaryArr;
+ } else {
+ hashArr_ = hashArr.clone();
+ summaryArr_ = summaryArr.clone();
Review Comment:
## CodeQL / Dereferenced variable may be null
Variable [summaryArr](1) may be null at this access because of [this](2)
null argument.
Variable [summaryArr](1) may be null at this access because of [this](3)
null argument.
Variable [summaryArr](1) may be null at this access because of [this](4)
null argument.
Variable [summaryArr](1) may be null at this access because of [this](5)
null argument.
Variable [summaryArr](1) may be null at this access because of [this](6)
null argument.
Variable [summaryArr](1) may be null at this access because of [this](7)
null argument.
Variable [summaryArr](1) may be null at this access because of [this](8)
null argument.
Variable [summaryArr](1) may be null at this access because of [this](9)
null argument.
Variable [summaryArr](1) may be null at this access because of [this](10)
null argument.
Variable [summaryArr](1) may be null at this access because of [this](11)
null argument.
Variable [summaryArr](1) may be null at this access because of [this](12)
null argument.
Variable [summaryArr](1) may be null at this access because of [this](13)
null argument.
Variable [summaryArr](1) may be null at this access because of [this](14)
null argument.
Variable [summaryArr](1) may be null at this access because of [this](15)
null argument.
Variable [summaryArr](1) may be null at this access because of [this](16)
null argument.
Variable [summaryArr](1) may be null at this access because of [this](17)
null argument.
[Show more
details](https://github.com/apache/datasketches-java/security/code-scanning/997)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]