File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -385,6 +385,11 @@ impl FromStr for InvocationUuid {
385385
386386 // ulid (u128)
387387 let raw_ulid: u128 = decoder. cursor . decode_next ( ) ?;
388+
389+ if decoder. cursor . remaining ( ) != 0 {
390+ return Err ( IdDecodeError :: Length ) ;
391+ }
392+
388393 Ok ( Self :: from ( raw_ulid) )
389394 }
390395}
@@ -743,6 +748,11 @@ impl FromStr for InvocationId {
743748 // ulid (u128)
744749 let raw_ulid: u128 = decoder. cursor . decode_next ( ) ?;
745750 let inner = InvocationUuid :: from ( raw_ulid) ;
751+
752+ if decoder. cursor . remaining ( ) != 0 {
753+ return Err ( IdDecodeError :: Length ) ;
754+ }
755+
746756 Ok ( Self {
747757 partition_key,
748758 inner,
Original file line number Diff line number Diff line change @@ -95,11 +95,21 @@ impl FromStr for VQueueEntryId {
9595 InvocationId :: RESOURCE_TYPE => {
9696 let partition_key: PartitionKey = decoder. cursor . decode_next ( ) ?;
9797 let raw: [ u8 ; REMAINDER_LEN ] = decoder. cursor . decode_next :: < u128 > ( ) ?. to_be_bytes ( ) ;
98+
99+ if decoder. cursor . remaining ( ) != 0 {
100+ return Err ( IdDecodeError :: Length ) ;
101+ }
102+
98103 Ok ( Self :: Invocation ( partition_key, raw) )
99104 }
100105 StateMutationId :: RESOURCE_TYPE => {
101106 let partition_key: PartitionKey = decoder. cursor . decode_next ( ) ?;
102107 let raw: [ u8 ; REMAINDER_LEN ] = decoder. cursor . decode_next :: < u128 > ( ) ?. to_be_bytes ( ) ;
108+
109+ if decoder. cursor . remaining ( ) != 0 {
110+ return Err ( IdDecodeError :: Length ) ;
111+ }
112+
103113 Ok ( Self :: StateMutation ( partition_key, raw) )
104114 }
105115 _ => Err ( IdDecodeError :: TypeMismatch ) ,
Original file line number Diff line number Diff line change @@ -256,6 +256,10 @@ impl FromStr for VQueueId {
256256 // the version of the encoded string.
257257 let rest: u128 = decoder. cursor . decode_next ( ) ?;
258258 buf. put_u128 ( rest) ;
259+
260+ if decoder. cursor . remaining ( ) != 0 {
261+ return Err ( IdDecodeError :: Length ) ;
262+ }
259263 }
260264
261265 Ok ( Self ( buf) )
You can’t perform that action at this time.
0 commit comments