{"record":{"id":"adbd7ce96f448990","repo":"zed-industries/zed","slug":"credential-for-url-is-bytes-which-exceeds-th","errorCode":null,"errorMessage":"credential for {url} is {} bytes, which exceeds the Windows Credential Manager limit of {CRED_MAX_CREDENTIAL_BLOB_SIZE} bytes","messagePattern":"credential for (.+?) is (.+?) bytes, which exceeds the Windows Credential Manager limit of (.+?) bytes","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_windows/src/platform.rs","lineNumber":902,"sourceCode":"                break;\n            }\n        }\n    }\n\n    fn is_cursor_visible(&self) -> bool {\n        self.inner.state.cursor_visible.load(Ordering::Relaxed)\n    }\n\n    fn should_auto_hide_scrollbars(&self) -> bool {\n        should_auto_hide_scrollbars().log_err().unwrap_or(false)\n    }\n\n    fn write_to_clipboard(&self, item: ClipboardItem) {\n        write_to_clipboard(item);\n    }\n\n    fn read_from_clipboard(&self) -> Option<ClipboardItem> {\n        read_from_clipboard()\n    }\n\n    fn write_credentials(&self, url: &str, username: &str, password: &[u8]) -> Task<Result<()>> {\n        // CredWriteW rejects larger blobs with the opaque RPC error\n        // 0x800706F7 \"The stub received bad data\", so fail with a clear\n        // message instead.\n        if password.len() > CRED_MAX_CREDENTIAL_BLOB_SIZE as usize {\n            return Task::ready(Err(anyhow!(\n                \"credential for {url} is {} bytes, which exceeds the Windows Credential Manager limit of {CRED_MAX_CREDENTIAL_BLOB_SIZE} bytes\",\n                password.len()\n            )));\n        }\n        let password = password.to_vec();\n        let mut username = username.encode_utf16().chain(Some(0)).collect_vec();\n        let mut target_name = windows_credentials_target_name(url)\n            .encode_utf16()\n            .chain(Some(0))\n            .collect_vec();","sourceCodeStart":884,"sourceCodeEnd":920,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/gpui_windows/src/platform.rs#L884-L920","documentation":"Pre-flight validation in `write_credentials`: the password blob exceeds CRED_MAX_CREDENTIAL_BLOB_SIZE (512 bytes), which CredWriteW would reject with the opaque RPC error 0x800706F7 'The stub received bad data'. The explicit check fails early with a clear message naming the URL and both sizes.","triggerScenarios":"Thrown at crates/gpui_windows/src/platform.rs:837 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reject or truncate oversized credentials at a higher layer before calling write_credentials.","Store large secrets outside Credential Manager (e.g. encrypted file with DPAPI) and keep a pointer in the credential.","Document the 512-byte blob limit for Windows credential users.","Return a typed error so callers can distinguish size failure from CredWriteW failure."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}