ci: release-images — advisory gates in a job without secrets, image job runs no third-party code before login, fresh config dir via GITHUB_ENV, run-id builder name, empty digest refused, cleanup order; docs: SAFETY markers consistent, iCCP fixture comment

This commit is contained in:
bchanot committed 2026-10-13 00:53:46 +02:00
1 parent 3af2861be7
commit 47d84161f5
4 files changed
+54 -26

No files matched your search

+2 -2
View File
@@ -163,9 +163,9 @@ pub fn encode_webp(rgba: &[u8], width: u32, height: u32, quality: f32) -> Result
if size == 0 || output.is_null() {
return Err(Reject::EncodeFailed);
}
// SAFETY: libwebp returned `size` initialised bytes at `output`.
// SAFETY [gated 2026-10-13]: libwebp returned `size` initialised bytes at `output`.
let encoded = unsafe { std::slice::from_raw_parts(output, size) }.to_vec();
// SAFETY: `output` came from libwebp's allocator and is not read afterwards.
// SAFETY [gated 2026-10-13]: `output` came from libwebp's allocator and is not read afterwards.
unsafe { libwebp_sys::WebPFree(output.cast()) };
Ok(encoded)
}
+5 -3
View File
@@ -62,9 +62,11 @@ fn push_chunk(out: &mut Vec<u8>, kind: &[u8; 4], payload: &[u8]) {
out.extend_from_slice(&hasher.finalize().to_be_bytes());
}
/// A small valid-looking PNG whose `iCCP` profile inflates to `inflated_bytes` (hundreds of
/// kilobytes of compressed zeros): the decoder's allocation budget must refuse it as content
/// (`resource_limit`), never as a broken environment.
/// A small PNG header whose `iCCP` profile inflates to `inflated_bytes` (hundreds of
/// kilobytes of compressed zeros) and that carries no image data: the decoder refuses it as
/// content (`decode_failed` or `resource_limit`, depending on which check fires first),
/// never as a broken environment. R1 adds a variant with image data so the budget itself
/// is seen firing.
pub fn png_iccp_bomb(inflated_bytes: usize) -> Vec<u8> {
use std::io::Write;
let mut out = vec![0x89, b'P', b'N', b'G', 0x0d, 0x0a, 0x1a, 0x0a];