Skip to content

Numeric limits for CTE #30

Description

@kengruven

I tried making a 2500-character integer (in CTE) and sending it to enctool. It happily made a >1KB CBE document. Then when I tried parsing that CBE with enctool, it said:

<nil>: uint length field is too big (max allowed value = 1024)

It looks like the CTE parser doesn't have the same limit check as CBE.

(Implementation note: since one format uses base-10 and the other uses base-128, what I'm doing is counting digits exactly for CTE, and checking the byte count against (maxdigits/10)*log(128) for CBE. I convinced myself that was correct, or close enough, though today I'm not so sure…)

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions