diff options
author | iphydf <iphydf@users.noreply.github.com> | 2020-05-02 20:49:41 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2020-05-02 21:47:08 +0100 |
commit | 2570ddcb17fdf5bea56c6bc1c5c2d04ba2068ee7 (patch) | |
tree | 621dd5a3953ad786650e50fdba2787009c78df95 /other | |
parent | e057bae563e133dbab7381ebbe1dc10f93d6eb4f (diff) |
Fix errors on error paths found by oomer.
* Use-after-free because we free network before dht in one case.
* Various unchecked allocs in tests (not so important).
* We used to not check whether ping arrays were actually allocated in DHT.
* `ping_kill` and `ping_array_kill` used to crash when passing NULL.
Also:
* Added an assert in all public API functions to ensure tox isn't NULL.
The error message you get from that is a bit nicer than "Segmentation
fault" when clients (or our tests) do things wrong.
* Decreased the sleep time in iterate_all_wait from 20ms to 5ms.
Everything seems to still work with 5ms, and this greatly decreases
the amount of time spent per test run, making oomer run much faster.
Diffstat (limited to 'other')
-rw-r--r-- | other/bootstrap_daemon/docker/tox-bootstrapd.sha256 | 2 | ||||
-rwxr-xr-x | other/bootstrap_daemon/docker/update-sha256 | 24 |
2 files changed, 25 insertions, 1 deletions
diff --git a/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 b/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 index 12c8c317..5287541b 100644 --- a/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 +++ b/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 | |||
@@ -1 +1 @@ | |||
c8bb5365e2cd01dab8d10a0d9c2e8f8e3be0996062151fbf95bf6304a0f1ecf1 /usr/local/bin/tox-bootstrapd | e7b6d31485b5e1561659be08f3e3ef003cef186042d7e0fe2ef48cf341932b5a /usr/local/bin/tox-bootstrapd | ||
diff --git a/other/bootstrap_daemon/docker/update-sha256 b/other/bootstrap_daemon/docker/update-sha256 new file mode 100755 index 00000000..78aa656f --- /dev/null +++ b/other/bootstrap_daemon/docker/update-sha256 | |||
@@ -0,0 +1,24 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -eux | ||
4 | |||
5 | docker_build() { | ||
6 | tar c $(git ls-files) | docker build -f other/bootstrap_daemon/docker/Dockerfile -t toxchat/bootstrap-node - | ||
7 | } | ||
8 | |||
9 | # Run Docker build once. If it succeeds, we're good. | ||
10 | if docker_build; then | ||
11 | exit 0 | ||
12 | fi | ||
13 | |||
14 | # We're not good. Run it again, but now capture the output. | ||
15 | OUTPUT=$(docker_build || true 2>&1) | ||
16 | |||
17 | if echo "$OUTPUT" | grep '/usr/local/bin/tox-bootstrapd: FAILED'; then | ||
18 | # This is a checksum warning, so we need to update it. | ||
19 | IMAGE=$(echo "$OUTPUT" | grep '^ ---> [0-9a-f]*$' | grep -o '[0-9a-f]*$' | tail -n1) | ||
20 | docker run --rm "$IMAGE" sha256sum /usr/local/bin/tox-bootstrapd > other/bootstrap_daemon/docker/tox-bootstrapd.sha256 | ||
21 | fi | ||
22 | |||
23 | # Run once last time to complete the build. | ||
24 | docker_build | ||