Skip to content

Panic in crypt.rs when slicing into key #126

@ghost

Description

thread '<unnamed>' panicked at 'range end index 32 out of range for slice of length 25', /home/jess/src/pdf/pdf/src/crypt.rs:572:17

crash.pdf

pdf/pdf/src/crypt.rs

Lines 569 to 575 in dc3016b

// b)
let mut key = [0; 16 + 5 + 4];
let n = self.key_size;
key[..n].copy_from_slice(self.key());
key[n..n + 3].copy_from_slice(&id.to_le_bytes()[..3]);
key[n + 3..n + 5].copy_from_slice(&gen.to_le_bytes()[..2]);
key[n + 5..n + 9].copy_from_slice(b"sAlT");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions