Skip to content

Building 70 Projects ranging from beginner to advanced so anyone can β€” learn from, build upon, use as a reference, or even copy directly. Owned by my cybersecurity company πŸ‘‡

feat(lisdex): B66 - the defect was already fixed and the clause guarding it could not fail

CarterPerez-deve7562f613e21
diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/scripts/m3-gate.sh b/PROJECTS/advanced/zero-day-vulnerability-scanner/scripts/m3-gate.sh
index d737405f..90ed7b5e 100755
--- a/PROJECTS/advanced/zero-day-vulnerability-scanner/scripts/m3-gate.sh
+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/scripts/m3-gate.sh
@@ -351,11 +351,31 @@ fi
# Isolates the binding rule from the run rule: `archive_read_free` is plumbing-shaped and
# sits inside the opening run of several targets, and `archive_read_set_options` takes a
# string. Neither may be replayed, and replaying the free would tear the handle down first.
-if echo "$REPLAY" | grep -qE "archive_read_free|archive_read_set_options"; then
+#
+# Both names are DOUBLY unreachable on this target and this assertion was measured vacuous:
+# the seek fuzzer's run breaks at `archive_read_set_read_callback` long before its
+# `archive_read_free` at position 13, and `emitted` would skip that free anyway because the
+# plan schedules it. Gutting `is_teardown` left the whole gate green - the unit test
+# `a_destructor_in_the_opening_run_is_never_replayed_as_setup` is what actually covers that
+# guard. Kept as the regression statement it always was, now with the liveness guard that
+# stops it passing on the empty replay a broken run rule produces.
+if [ -z "$REPLAY" ]; then
+ bad "no replay line to assert against, so the teardown assertion would pass vacuously"
+elif echo "$REPLAY" | grep -qE "archive_read_free|archive_read_set_options"; then
bad "libarchive replayed a teardown or a string-taking call as setup: $REPLAY"
else
ok "only handle-taking registrations are replayed, no teardown and no string-taking call"
fi
+# The live negative control for the run rule, and the one the clause above cannot be. With
+# `is_plumbing` gutted to always return true the run walks past the callback setters it
+# cannot bind and reaches the author's OWN opener: the replay becomes the six registrations
+# plus `archive_read_open1`, which would open the archive a second time before ours ever
+# runs. Measured, so this reddens alone when the break rule is loosened.
+if echo "$REPLAY" | grep -q "archive_read_open1"; then
+ bad "the run walked past the callback setters and replayed a second opener: $REPLAY"
+else
+ ok "the replay stops at the first call it cannot bind, so no second opener is replayed"
+fi
# A harness that never passes the corpus to the library is a constant program: every seed
# drives the same code and any crash it reports is one we manufactured.