Skip to content

Out of bound issues don't return a nice error #142

Description

@DanGould

let re = PublicKey::from_slice(&message_b[..33])?;
let nonce = Nonce::from_slice(&message_b[33..45]);

resulting in a panic:

Sent fallback transaction
thread 'main' panicked at payjoin/src/v2.rs:90:46:
range end index 33 out of range for slice of length 0
range end index 33 out of range for slice of length 0

These should use fallable data indexing and map to a nice error

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueDoes NOT mean "an LLM can do this." Please discuss the constraints and intended approach.sendsending payjoin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions