nonnative 2.10.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +2 -2
- data/Gemfile.lock +1 -1
- data/lib/nonnative/invalid_data_socket_pair.rb +29 -1
- data/lib/nonnative/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 304dcea40b84eda206fe9964fe1479a54e0188f52f2a5300dbcf992101cab2b3
|
|
4
|
+
data.tar.gz: a6adb1b816c424709ab337d1b845dd106ff5141ddb6f26bfe73318c4f51bed23
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a7d8afad5ad7ff9b550c67fe73a683da85ae1bcfa611e0b25b0d570f44ebd5beba47ab50287d58206a51d6d61722bf42ae893929d2c4a99d5ea53b2e033fae91
|
|
7
|
+
data.tar.gz: 506907d924a16c49d583a91e78a7c6e17bb03e3e5d879f00f43e8d4313fb57957bf545538d2953d056ab0c3eecb94ff29ab9a1af22547c890c1a1e56e3f0335c
|
data/.circleci/config.yml
CHANGED
|
@@ -25,8 +25,8 @@ jobs:
|
|
|
25
25
|
- vendor
|
|
26
26
|
- run: make lint
|
|
27
27
|
- run: make sec
|
|
28
|
-
- run: COVERAGE_NAME="
|
|
29
|
-
- run: COVERAGE_NAME="
|
|
28
|
+
- run: COVERAGE_NAME="Features" make features
|
|
29
|
+
- run: COVERAGE_NAME="Benchmarks" make benchmarks
|
|
30
30
|
- store_test_results:
|
|
31
31
|
path: test/reports
|
|
32
32
|
- store_artifacts:
|
data/Gemfile.lock
CHANGED
|
@@ -29,7 +29,35 @@ module Nonnative
|
|
|
29
29
|
private
|
|
30
30
|
|
|
31
31
|
def corrupt(data)
|
|
32
|
-
|
|
32
|
+
payload, delimiter = split_trailing_delimiter(data)
|
|
33
|
+
return "\0#{delimiter}" if payload.empty?
|
|
34
|
+
|
|
35
|
+
"#{corrupt_payload(payload)}#{delimiter}"
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def split_trailing_delimiter(data)
|
|
39
|
+
index = trailing_delimiter_start(data)
|
|
40
|
+
payload = data.byteslice(0, index)
|
|
41
|
+
delimiter = data.byteslice(index, data.bytesize - index) || ''
|
|
42
|
+
|
|
43
|
+
[payload, delimiter]
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def trailing_delimiter_start(data)
|
|
47
|
+
index = data.bytesize
|
|
48
|
+
|
|
49
|
+
while index.positive?
|
|
50
|
+
byte = data.getbyte(index - 1)
|
|
51
|
+
break unless [10, 13].include?(byte)
|
|
52
|
+
|
|
53
|
+
index -= 1
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
index
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def corrupt_payload(payload)
|
|
60
|
+
bytes = payload.bytes
|
|
33
61
|
corrupted = bytes.shuffle
|
|
34
62
|
return corrupted.pack('C*') unless corrupted == bytes
|
|
35
63
|
|
data/lib/nonnative/version.rb
CHANGED