forked from BigfootDev/flatbuffers
Compare commits
1 Commits
master
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ffc8d8346 |
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@@ -51,7 +51,7 @@ jobs:
|
|||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
run: zip Linux.flatc.binary.${{ matrix.cxx }}.zip flatc
|
run: zip Linux.flatc.binary.${{ matrix.cxx }}.zip flatc
|
||||||
- name: Release zip file
|
- name: Release zip file
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v3
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
with:
|
||||||
files: Linux.flatc.binary.${{ matrix.cxx }}.zip
|
files: Linux.flatc.binary.${{ matrix.cxx }}.zip
|
||||||
@@ -179,7 +179,7 @@ jobs:
|
|||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
run: move Release/flatc.exe . && Compress-Archive flatc.exe Windows.flatc.binary.zip
|
run: move Release/flatc.exe . && Compress-Archive flatc.exe Windows.flatc.binary.zip
|
||||||
- name: Release binary
|
- name: Release binary
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v3
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
with:
|
||||||
files: Windows.flatc.binary.zip
|
files: Windows.flatc.binary.zip
|
||||||
@@ -255,7 +255,7 @@ jobs:
|
|||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
run: mv Release/flatc . && zip MacIntel.flatc.binary.zip flatc
|
run: mv Release/flatc . && zip MacIntel.flatc.binary.zip flatc
|
||||||
- name: Release binary
|
- name: Release binary
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v3
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
with:
|
||||||
files: MacIntel.flatc.binary.zip
|
files: MacIntel.flatc.binary.zip
|
||||||
@@ -298,7 +298,7 @@ jobs:
|
|||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
run: mv Release/flatc . && zip Mac.flatc.binary.zip flatc
|
run: mv Release/flatc . && zip Mac.flatc.binary.zip flatc
|
||||||
- name: Release binary
|
- name: Release binary
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v3
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
with:
|
||||||
files: Mac.flatc.binary.zip
|
files: Mac.flatc.binary.zip
|
||||||
|
|||||||
@@ -56,15 +56,8 @@ extension Verifiable {
|
|||||||
let len: UOffset = try verifier.getValue(at: position)
|
let len: UOffset = try verifier.getValue(at: position)
|
||||||
let intLen = Int(len)
|
let intLen = Int(len)
|
||||||
let start = Int(clamping: (position &+ MemoryLayout<Int32>.size).magnitude)
|
let start = Int(clamping: (position &+ MemoryLayout<Int32>.size).magnitude)
|
||||||
let byteCount = intLen.multipliedReportingOverflow(
|
|
||||||
by: MemoryLayout<T>.size)
|
|
||||||
guard !byteCount.overflow else {
|
|
||||||
throw FlatbuffersErrors.outOfBounds(
|
|
||||||
position: UInt.max,
|
|
||||||
end: verifier.capacity)
|
|
||||||
}
|
|
||||||
try verifier.isAligned(position: start, type: type.self)
|
try verifier.isAligned(position: start, type: type.self)
|
||||||
try verifier.rangeInBuffer(position: start, size: byteCount.partialValue)
|
try verifier.rangeInBuffer(position: start, size: intLen)
|
||||||
return (start, intLen)
|
return (start, intLen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -411,27 +411,6 @@ final class FlatbuffersVerifierTests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(.bug("https://github.com/google/flatbuffers/issues/9082"))
|
|
||||||
func testRejectsTruncatedScalarVector() {
|
|
||||||
// swiftformat:disable all
|
|
||||||
var byteBuffer = ByteBuffer(bytes: [
|
|
||||||
16, 0, 0, 0,
|
|
||||||
6, 0, 8, 0,
|
|
||||||
4, 0, 0, 0,
|
|
||||||
0, 0, 0, 0,
|
|
||||||
12, 0, 0, 0,
|
|
||||||
8, 0, 0, 0,
|
|
||||||
0, 0, 0, 0,
|
|
||||||
2, 0, 0, 0,
|
|
||||||
65, 66,
|
|
||||||
])
|
|
||||||
// swiftformat:enable all
|
|
||||||
|
|
||||||
#expect(throws: FlatbuffersErrors.self) {
|
|
||||||
try getCheckedRoot(byteBuffer: &byteBuffer) as Swift_Tests_Vectors
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
func testValidUnionBuffer() {
|
func testValidUnionBuffer() {
|
||||||
let string = "Awesome \\\\t\t\nstring!"
|
let string = "Awesome \\\\t\t\nstring!"
|
||||||
|
|||||||
Reference in New Issue
Block a user