rustdesk/rustdesk · error · CliprdrError

cliprdr out of memory

Error message

cliprdr out of memory

What it means

CliprdrError::CliprdrOutOfMemory variant ('cliprdr out of memory'): the clipboard backend (typically the FUSE/cliprdr bridge) exhausted memory while allocating buffers for a file-list or file-contents operation. Large clipboard file transfers allocate proportionally to the advertised data size, so an oversized or malicious file list from the remote peer can trip this guard.

Source

Thrown at libs/clipboard/src/lib.rs:77

    /// set to be stopped
    fn set_is_stopped(&mut self) -> Result<(), CliprdrError>;
    /// clear the content on clipboard
    fn empty_clipboard(&mut self, conn_id: i32) -> Result<bool, CliprdrError>;
    /// run as a server for clipboard RPC
    fn server_clip_file(&mut self, conn_id: i32, msg: ClipboardFile) -> Result<(), CliprdrError>;
    /// get the progress of the paste task.
    fn get_progress_percent(&self) -> Option<ProgressPercent>;
    /// cancel the paste task.
    fn cancel(&mut self);
}

#[derive(Error, Debug)]
pub enum CliprdrError {
    #[error("invalid cliprdr name")]
    CliprdrName,
    #[error("failed to init cliprdr")]
    CliprdrInit,
    #[error("cliprdr out of memory")]
    CliprdrOutOfMemory,
    #[error("cliprdr internal error")]
    ClipboardInternalError,
    #[error("cliprdr occupied")]
    ClipboardOccupied,
    #[error("conversion failure")]
    ConversionFailure,
    #[error("failure to read clipboard")]
    OpenClipboard,
    #[error("failure to read file metadata or content, path: {path}, err: {err}")]
    FileError { path: String, err: std::io::Error },
    #[error("invalid request: {description}")]
    InvalidRequest { description: String },
    #[error("common request: {description}")]
    CommonError { description: String },
    #[error("unknown cliprdr error")]
    Unknown(u32),
}

View on GitHub (pinned to 91c9fccbb0)

Solutions

  1. Cap the number/size of entries accepted in a clipboard file list before allocating
  2. Free and re-request in smaller chunks rather than buffering whole file contents
  3. If triggered by a remote peer's advertisement, drop the clipboard session and re-negotiate instead of retrying the same allocation
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at libs/clipboard/src/lib.rs:77 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of rustdesk/rustdesk@91c9fccbb0 (2026-09-10). Data as JSON: /api/errors/892bc56e0926d436. Report an issue: GitHub.