You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "songqing (via GitHub)" <gi...@apache.org> on 2026/04/03 08:05:34 UTC
[PR] fix(zset): initialize *inter_cnt before early return in InterCard [kvrocks]
songqing opened a new pull request, #3421:
URL: https://github.com/apache/kvrocks/pull/3421
When any input key is empty (mscores.empty()), InterCard returned OK
without ever assigning *inter_cnt, leaving callers with an
uninitialized value. Redis ZINTERCARD should return 0 in this case.
Fix by initializing *inter_cnt = 0 at the function entry.
Although the count at the caller layer is initialized to 0, which seems to be fortuitously safe, other potential callers (such as internal calls, test code, and future refactoring) may not necessarily initialize it beforehand.
--
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: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(zset): initialize *inter_cnt before early return in InterCard [kvrocks]
Posted by "songqing (via GitHub)" <gi...@apache.org>.
songqing commented on PR #3421:
URL: https://github.com/apache/kvrocks/pull/3421#issuecomment-4186786795
> Speaking strictly about this PR, I have no objections. Adding defensive code can certainly improve the robustness of the code.
>
> However, I do have one question: does this specific coding style align with our established conventions?
Thanks for your comment, I push this PR only want to fix the potential bug as I mentioned in the description, as coding style, it's hard to follow for everyone.
--
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: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(zset): initialize *inter_cnt before early return in InterCard [kvrocks]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3421:
URL: https://github.com/apache/kvrocks/pull/3421#issuecomment-4205598777
## [](https://sonarcloud.io/dashboard?id=apache_kvrocks&pullRequest=3421) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_kvrocks&pullRequest=3421&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_kvrocks&pullRequest=3421&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_kvrocks&pullRequest=3421&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [69.7% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_kvrocks&pullRequest=3421&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_kvrocks&pullRequest=3421&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_kvrocks&pullRequest=3421)
--
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: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(zset): initialize *inter_cnt before early return in InterCard [kvrocks]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #3421:
URL: https://github.com/apache/kvrocks/pull/3421#issuecomment-4187063805
## [](https://sonarcloud.io/dashboard?id=apache_kvrocks&pullRequest=3421) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_kvrocks&pullRequest=3421&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_kvrocks&pullRequest=3421&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_kvrocks&pullRequest=3421&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [100.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_kvrocks&pullRequest=3421&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_kvrocks&pullRequest=3421&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_kvrocks&pullRequest=3421)
--
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: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(zset): initialize *inter_cnt before early return in InterCard [kvrocks]
Posted by "jihuayu (via GitHub)" <gi...@apache.org>.
jihuayu merged PR #3421:
URL: https://github.com/apache/kvrocks/pull/3421
--
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: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(zset): initialize *inter_cnt before early return in InterCard [kvrocks]
Posted by "jihuayu (via GitHub)" <gi...@apache.org>.
jihuayu commented on PR #3421:
URL: https://github.com/apache/kvrocks/pull/3421#issuecomment-4203126831
Looks like there’s an issue with the CI. I’ll look into it.
--
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: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org