Complete plan execution: gossip/raft bounds, deadlock fix, JSON escaping, memtable limits
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
Remaining plan items: - 1.4 hybrid_search: JSON built with std/json instead of string concat - 2.3 lsm.nim: reject oversized memtable entries - 3.3 gossip.nim: bounds checking for idLen/nodeCount/hostLen - 3.4 raft.nim: max length caps for cmdLen/dataLen/logLen - 4.3 deadlock.nim: per-path seq stack instead of global parent table
This commit is contained in:
@@ -115,13 +115,19 @@ proc loadState(node: RaftNode) =
|
||||
if votedForLen > 0:
|
||||
node.votedFor = s.readStr(votedForLen)
|
||||
let logLen = int(s.readUint32())
|
||||
if logLen > 1_000_000:
|
||||
raise newException(ValueError, "Raft log length too large")
|
||||
node.log = newSeq[LogEntry](logLen)
|
||||
for i in 0..<logLen:
|
||||
let term = s.readUint64()
|
||||
let index = s.readUint64()
|
||||
let cmdLen = int(s.readUint32())
|
||||
if cmdLen > 1_000_000:
|
||||
raise newException(ValueError, "Raft command length too large")
|
||||
let cmd = s.readStr(cmdLen)
|
||||
let dataLen = int(s.readUint32())
|
||||
if dataLen > 10_000_000:
|
||||
raise newException(ValueError, "Raft data length too large")
|
||||
var data = newSeq[byte](dataLen)
|
||||
if dataLen > 0:
|
||||
if s.readData(addr data[0], dataLen) != dataLen:
|
||||
|
||||
Reference in New Issue
Block a user