Skip to content
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

Version store #9

Draft
wants to merge 31 commits into
base: version-store
Choose a base branch
from
Draft

Version store #9

wants to merge 31 commits into from

Conversation

mmsqe
Copy link

@mmsqe mmsqe commented Oct 25, 2022

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

file/watcher.go Fixed Show fixed Hide fixed
file/watcher.go Fixed Show fixed Hide fixed
file/decoder.go Fixed Show fixed Hide fixed
file/decoder.go Fixed Show fixed Hide fixed
file/watcher.go Fixed Show fixed Hide fixed
file/watcher.go Fixed Show fixed Hide fixed
file/watcher.go Fixed Show fixed Hide fixed

func (c *WebsocketClient) Close() {
if c.wsconn != nil {
c.wsconn.Close(websocket.StatusNormalClosure, "")

Check warning

Code scanning / gosec

Errors unhandled.

Errors unhandled.
app/app.go Fixed Show fixed Hide fixed
client/file/watcher.go Fixed Show fixed Hide fixed
client/file/watcher.go Fixed Show fixed Hide fixed
client/file/decoder.go Fixed Show fixed Hide fixed
client/file/decoder.go Fixed Show fixed Hide fixed
client/file/watcher.go Fixed Show fixed Hide fixed
client/file/watcher.go Fixed Show fixed Hide fixed
client/file/watcher.go Fixed Show fixed Hide fixed
client/file/sync.go Fixed Show fixed Hide fixed
return nil, err
}
pairs = append(pairs, *pair)
offset += int(size)

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion
size, n := proto.DecodeVarint(data[offset:])
offset += n
pair := new(types.StoreKVPair)
if err := proto.Unmarshal(data[offset:offset+int(size)], pair); err != nil {

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion
Comment on lines +209 to +212
for k, _ := range finishedBlockNums {
if k <= blockNum {
delete(finishedBlockNums, k)
}
}

Check failure

Code scanning / gosec

the value in the range statement should be _ unless copying a map: want: for key := range m

the value in the range statement should be _ unless copying a map: want: for key := range m
client/file/watcher.go Fixed Show fixed Hide fixed
client/file/watcher.go Fixed Show fixed Hide fixed
client/file/watcher.go Fixed Show fixed Hide fixed
Comment on lines +372 to +374
for _, storeKey := range keys {
exposeStoreKeys = append(exposeStoreKeys, storeKey)
}

Check failure

Code scanning / gosec

the value in the range statement should be _ unless copying a map: want: for key := range m

the value in the range statement should be _ unless copying a map: want: for key := range m
var bytes [8]byte
if _, err = io.ReadFull(f, bytes[:]); err == nil {
size := binary.BigEndian.Uint64(bytes[:])
if info, err := f.Stat(); err == nil && size+uint64(8) == uint64(info.Size()) {

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion
},
func(blockNum int) bool {
path := GetLocalDataFileName(directory, blockNum)
f, err := os.Open(path)

Check failure

Code scanning / gosec

Potential file inclusion via variable

Potential file inclusion via variable
f, err := os.Open(path)
if err == nil {
defer func() {
_ = f.Close()

Check warning

Code scanning / gosec

Returned error is not propagated up the stack.

Returned error is not propagated up the stack.
offset := prefixLen
dataSize := sdk.BigEndianToUint64(data[:offset])
size := len(data)
if int(dataSize)+prefixLen != size {

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion
versiondb/tmdb/store.go Fixed Show fixed Hide fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant