-
Notifications
You must be signed in to change notification settings - Fork 909
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
[ads] General code health #27587
base: master
Are you sure you want to change the base?
[ads] General code health #27587
Conversation
// Invalid pref path key, because this should be an integer index for the | ||
// list. | ||
return std::nullopt; | ||
} | ||
|
||
const base::Value::List& list = pref_value.GetList(); | ||
|
||
if (index < 0 || index >= static_cast<int>(list.size())) { | ||
if (index < 0 || index >= list.size()) { |
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.
reported by reviewdog 🐶
[semgrep] Checking if an unsigned variable is negative makes no sense and is usually a good indication that something is probably wrong with the code.
Source: https://github.com/0xdea/semgrep-rules/blob/main/c/incorrect-unsigned-comparison.yaml
Cc @thypon @kdenhartog
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.
Fixed.
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.
Fixed
8c7ccfc
to
963d499
Compare
963d499
to
a1ebc79
Compare
[puLL-Merge] - brave/brave-core@27587 Here's my review of the changes: DescriptionThis PR refactors integer types in Brave Ads code to use ChangesChangesBy filename:
sequenceDiagram
participant Client
participant TokenGenerator
participant BatchDLEQProof
participant TokenIssuer
Client->>TokenGenerator: Request token generation (size_t count)
TokenGenerator-->>Client: Return raw tokens
Client->>TokenIssuer: Request token signing
TokenIssuer->>BatchDLEQProof: Generate proof
BatchDLEQProof-->>Client: Return signed tokens
Client->>Client: Store tokens (size_t max)
Security Hotspots
Let me know if you would like me to elaborate on any part of the review. |
Resolves brave/brave-browser#43838
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: