{"record":{"id":"fef17ff48374a64a","repo":"BigPizzaV3/CodexPlusPlus","slug":"dream-skin-1-32","errorCode":null,"errorMessage":"Dream Skin 主题包文件数量必须在 1 到 32 之间","messagePattern":"Dream Skin 主题包文件数量必须在 1 到 32 之间","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_package.rs","lineNumber":97,"sourceCode":"    pub theme: Value,\n    pub image_name: String,\n    pub image_bytes: Vec<u8>,\n    pub css: String,\n    pub manifest_bytes: Vec<u8>,\n    pub license_bytes: Option<Vec<u8>>,\n}\n\npub fn validate_and_read_package(\n    bytes: &[u8],\n    platform: &str,\n) -> anyhow::Result<ValidatedDreamSkinPackage> {\n    if bytes.is_empty() || bytes.len() > PACKAGE_LIMIT {\n        bail!(\"Dream Skin 主题包超过 32 MiB 限制\");\n    }\n    let mut archive =\n        ZipArchive::new(Cursor::new(bytes)).context(\"Dream Skin 主题包不是有效 ZIP\")?;\n    if archive.len() == 0 || archive.len() > FILE_LIMIT {\n        bail!(\"Dream Skin 主题包文件数量必须在 1 到 32 之间\");\n    }\n\n    let mut entries = Vec::new();\n    let mut unpacked = 0usize;\n    for index in 0..archive.len() {\n        let file = archive\n            .by_index(index)\n            .context(\"读取 Dream Skin ZIP 条目失败\")?;\n        let name = file.name().to_string();\n        validate_archive_entry_name(&name)?;\n        if file.encrypted() || file.is_symlink() {\n            bail!(\"主题包包含加密内容或链接：{name}\");\n        }\n        if file.is_dir() {\n            entries.push((name, None));\n            continue;\n        }\n        let base_name = name.rsplit('/').next().unwrap_or_default();","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_package.rs#L79-L115","documentation":"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.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_package.rs:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rebuild the package with only the required files (manifest.json, theme.json, theme.css, background image, optional LICENSE.txt/manifest.sig)","Remove extra files from the ZIP"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}