fix(bf-2zdma): restore content fuzz harness and verify build
- Restore fuzz/fuzz_targets/content.rs from commit b05a90c6 - File was missing from current tree but defined in Cargo.toml - Verify cargo fuzz build content completes successfully - Add verification note at notes/bf-2zdma.md Acceptance criteria: - cargo fuzz build content completes successfully: PASS - No compilation errors or warnings: PASS - fuzz/target directory exists and contains build artifacts: PASS - All fuzz dependencies are resolved: PASS Closes bf-2zdma
This commit is contained in:
parent
b2ec99072a
commit
3e10daa2a1
2 changed files with 61 additions and 0 deletions
22
fuzz/fuzz_targets/content.rs
Normal file
22
fuzz/fuzz_targets/content.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
//! Fuzz target for the PDF content stream interpreter.
|
||||
//!
|
||||
//! This target tests INV-8 (no panic at public boundary) for the content stream interpreter.
|
||||
//! Any panic indicates a content stream bug that must be fixed.
|
||||
|
||||
#![no_main]
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
use pdftract_core::content_stream::{process_with_mode, ProcessingMode};
|
||||
use pdftract_core::parser::resources::ResourceDict;
|
||||
|
||||
// The content stream interpreter must never panic on any input
|
||||
// Create a minimal empty resource dict for testing
|
||||
let resources = ResourceDict::new();
|
||||
|
||||
// Test in Normal mode
|
||||
let _ = process_with_mode(data, &resources, ProcessingMode::Normal, None);
|
||||
|
||||
// Test in PositionHint mode
|
||||
let _ = process_with_mode(data, &resources, ProcessingMode::PositionHint, None);
|
||||
});
|
||||
39
notes/bf-2zdma.md
Normal file
39
notes/bf-2zdma.md
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
# Verification: bf-2zdma - Verify fuzz harness builds without errors
|
||||
|
||||
## Date
|
||||
2026-07-05
|
||||
|
||||
## Task
|
||||
Verify that the content fuzz harness compiles successfully and all dependencies are properly configured.
|
||||
|
||||
## Findings
|
||||
|
||||
### Issue Discovered
|
||||
The `content.rs` fuzz target was defined in `fuzz/Cargo.toml` but the source file `fuzz/fuzz_targets/content.rs` was missing from the current tree. The file existed in commit `b05a90c6` ("chore: add fuzz harness content parser") but was not present in the current working tree or HEAD.
|
||||
|
||||
### Resolution
|
||||
Restored `fuzz/fuzz_targets/content.rs` from commit `b05a90c6`. The file contains:
|
||||
- Fuzz target for PDF content stream interpreter
|
||||
- Tests INV-8 (no panic at public boundary)
|
||||
- Tests both `ProcessingMode::Normal` and `ProcessingMode::PositionHint`
|
||||
|
||||
### Build Verification
|
||||
- Command: `cargo fuzz build content`
|
||||
- Result: **SUCCESS** - no compilation errors or warnings
|
||||
- Build artifact: `fuzz/target/x86_64-unknown-linux-gnu/release/content` (56.5 MB)
|
||||
- Build timestamp: 2026-07-05 17:26
|
||||
|
||||
### Acceptance Criteria Status
|
||||
| Criterion | Status |
|
||||
|-----------|--------|
|
||||
| `cargo fuzz build content` completes successfully | ✅ PASS |
|
||||
| No compilation errors or warnings | ✅ PASS |
|
||||
| fuzz/target directory exists and contains build artifacts | ✅ PASS |
|
||||
| All fuzz dependencies are resolved | ✅ PASS |
|
||||
|
||||
## Artifacts Created
|
||||
- Restored: `fuzz/fuzz_targets/content.rs`
|
||||
- Build artifact: `fuzz/target/x86_64-unknown-linux-gnu/release/content`
|
||||
|
||||
## Conclusion
|
||||
The fuzz harness builds successfully. The missing `content.rs` file was restored from git history. All acceptance criteria are **PASS**.
|
||||
Loading…
Add table
Reference in a new issue