mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-06 18:35:19 +00:00
Early error check in golang struct reading
avoids a timeout on malformed input found by fuzzing
This commit is contained in:
parent
cc70b4e89a
commit
62beb6751d
@ -122,11 +122,14 @@ func Skip(ctx context.Context, self TProtocol, fieldType TType, maxDepth int) (e
|
||||
return err
|
||||
}
|
||||
for {
|
||||
_, typeId, _, _ := self.ReadFieldBegin(ctx)
|
||||
_, typeId, _, err := self.ReadFieldBegin(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if typeId == STOP {
|
||||
break
|
||||
}
|
||||
err := Skip(ctx, self, typeId, maxDepth-1)
|
||||
err = Skip(ctx, self, typeId, maxDepth-1)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user