Skip to content

Add ability to disable/set depth limitΒ #25

Closed

Description

@MarshalX

Hello! cbor4ii's decoder comes with deep limit which could be disabled/increased by implementing own dec::Read. But serde_ipld_dagcbor implements it's own including deep limit. So I'm wondering is there any simple way to disable/increase it? For now i just copied de.rs to my codebase which is not pretty

I use serde_ipld_dagcbor like this:

//! Read a general CBOR value with an unknown content.
//!
//! ```rust
//! use serde_ipld_dagcbor::from_slice;
//! use libipld_core::ipld::Ipld;
//!
//! let slice = b"\x82\x01\xa1aaab";
//! let value: Ipld = from_slice(slice).unwrap();
//! println!("{:?}", value); // List([Integer(1), Map({"a": String("b")})])
//! ```

upd. as i understand serde_ipld_dagcbor doesn't tune depth limit at all. so the default (256) comes from cbor4ii. which is too small for me

Activity

  1. vmx commented on Mar 1, 2024

    @vmx
    Member

    @MarshalX would it help if the Deserializer would be public? I think then you could implement it for your own reader with your own limits.

  2. vmx commented on Mar 26, 2024

    @vmx
    Member

    @MarshalX In the most recent release is the Deserializer public. Did you have have chance to see if setting the depth limit now works for you?

  3. MarshalX commented on Mar 27, 2024

    @MarshalX
    Author

    hi @vmx and thank you for your effort! i'm a bit busy these days but i'll try to verify as soon as i can. sorry for the long response

  4. vmx commented on Sep 3, 2025

    @vmx
    Member

    It's been a while and it's totally fine if priorities shift. I dare to close this issue as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions