We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
postgres-nio/Sources/PostgresNIO/Utilities/NIOUtils.swift
Lines 110 to 128 in bfc0a99
The code above allows the user to read uninitialised memory which is a security vulnerability.
A better way to write this function is
func getUUID(index: Int) -> UUID? { var uuid: uuid_t = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) return self.viewBytes(at: index, length: MemoryLayout.size(ofValue: uuid)).map { bufferBytes in withUnsafeMutableBytes(of: &uuid) { target in precondition(target.count <= bufferBytes.count) target.copyBytes(from: bufferBytes) } return UUID(uuid: uuid) } }
The text was updated successfully, but these errors were encountered:
fix getUUID method, #45
cd7eee2
fix incorrect usages of NIO unsafe API (#48)
985a3f5
* fix string->bytes method, #44 * fix getUUID method, #45 * at label * better readFloat/Double methods, #46 * remove unused get float/double methods
Successfully merging a pull request may close this issue.
postgres-nio/Sources/PostgresNIO/Utilities/NIOUtils.swift
Lines 110 to 128 in bfc0a99
The code above allows the user to read uninitialised memory which is a security vulnerability.
A better way to write this function is
The text was updated successfully, but these errors were encountered: