BigPizzaV3/CodexPlusPlus · error

Dream Skin 主题包文件数量必须在 1 到 32 之间

Error message

Dream Skin 主题包文件数量必须在 1 到 32 之间

What it means

Thrown by validate_and_read_package when the opened ZIP archive contains zero entries or more than FILE_LIMIT (32) entries. This is a structural sanity guard on untrusted theme packages: an empty archive is corrupt, and >32 files suggests a zip-bomb or a package that does not match the expected Dream Skin bundle shape. The offending input is the entry count of the submitted ZIP bytes.

Source

Thrown at crates/codex-plus-core/src/dream_skin_package.rs:97

    pub theme: Value,
    pub image_name: String,
    pub image_bytes: Vec<u8>,
    pub css: String,
    pub manifest_bytes: Vec<u8>,
    pub license_bytes: Option<Vec<u8>>,
}

pub fn validate_and_read_package(
    bytes: &[u8],
    platform: &str,
) -> anyhow::Result<ValidatedDreamSkinPackage> {
    if bytes.is_empty() || bytes.len() > PACKAGE_LIMIT {
        bail!("Dream Skin 主题包超过 32 MiB 限制");
    }
    let mut archive =
        ZipArchive::new(Cursor::new(bytes)).context("Dream Skin 主题包不是有效 ZIP")?;
    if archive.len() == 0 || archive.len() > FILE_LIMIT {
        bail!("Dream Skin 主题包文件数量必须在 1 到 32 之间");
    }

    let mut entries = Vec::new();
    let mut unpacked = 0usize;
    for index in 0..archive.len() {
        let file = archive
            .by_index(index)
            .context("读取 Dream Skin ZIP 条目失败")?;
        let name = file.name().to_string();
        validate_archive_entry_name(&name)?;
        if file.encrypted() || file.is_symlink() {
            bail!("主题包包含加密内容或链接:{name}");
        }
        if file.is_dir() {
            entries.push((name, None));
            continue;
        }
        let base_name = name.rsplit('/').next().unwrap_or_default();

View on GitHub (pinned to f2074595a2)

Solutions

  1. Rebuild the package with only the required files (manifest.json, theme.json, theme.css, background image, optional LICENSE.txt/manifest.sig)
  2. Remove extra files from the ZIP
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/codex-plus-core/src/dream_skin_package.rs:97 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23). Data as JSON: /api/errors/fef17ff48374a64a. Report an issue: GitHub.