Skip to content

Commit

Permalink
Fixed null terminator in sub-BSON documents
Browse files Browse the repository at this point in the history
  • Loading branch information
Joannis committed Feb 8, 2017
1 parent 046c557 commit d73f44e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Document.swift
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public struct Document : Collection, ExpressibleByDictionaryLiteral, Expressible
return
}

storage = Array(data[data.startIndex..<data.endIndex])
storage = Array(data[data.startIndex..<data.endIndex.advanced(by: -1)])
var length: UInt32 = 0

memcpy(&length, &storage, 4)
Expand Down

0 comments on commit d73f44e

Please sign in to comment.