Many of the algorithms in structured-headers are defined as taking input_string and returning a parsed X after modifying input_string to remove the X. This is a pretty common way of building an inline parser.
Take label, which describes an initial step of:
If input_string contains more than 256 characters, throw an error.
But a label can be followed by other things that will cause the overall string to exceed this length. So this check is invalid.
I'd recommend moving the size checks into the algorithm body. If X exceeds length maxlen(X), then throw as you are scrubbing through.
Many of the algorithms in structured-headers are defined as taking input_string and returning a parsed X after modifying input_string to remove the X. This is a pretty common way of building an inline parser.
Take label, which describes an initial step of:
But a label can be followed by other things that will cause the overall string to exceed this length. So this check is invalid.
I'd recommend moving the size checks into the algorithm body. If X exceeds length maxlen(X), then throw as you are scrubbing through.