-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
stream bulk #9308
base: main
Are you sure you want to change the base?
stream bulk #9308
Conversation
b271d82
to
fe0f67d
Compare
if err == nil { | ||
pDir := filepath.Join(basePath, entry.Name(), "p") | ||
if _, err := os.Stat(pDir); err == nil { | ||
groupDirs[uint32(groupID)] = pDir |
Check failure
Code scanning / CodeQL
Incorrect conversion between integer types High
strconv.Atoi
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 7 days ago
To fix the problem, we need to ensure that the value parsed from the directory name is within the valid range for uint32
before performing the conversion. We can achieve this by using strconv.ParseUint
with a bit size of 32, which directly parses the string into a uint32
value. This approach avoids the need for an additional bounds check.
-
Copy modified line R127
@@ -126,3 +126,3 @@ | ||
if entry.IsDir() { | ||
groupID, err := strconv.Atoi(entry.Name()) | ||
groupID, err := strconv.ParseUint(entry.Name(), 10, 32) | ||
if err == nil { |
fe0f67d
to
57ab93a
Compare
Description
Please explain the changes you made here.
Checklist
CHANGELOG.md
file describing and linking tothis PR
docs repo staged and linked here
Instructions
syntax, leading with
fix:
,feat:
,chore:
,ci:
, etc.link to the bug.
[x]
syntax.back and check the box later.
Instructions
line and everything below it, to indicate you have read and arefollowing these instructions. 🙂
Thank you for your contribution to Dgraph!