Fix protobuf runtime panic on startup
Regenerated protobuf stubs and bumped google.golang.org/protobuf from v1.36.10 to v1.36.11 to match protoc-gen-go v1.36.11. The version mismatch caused a panic in filedesc.unmarshalSeed during init(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
26
vendor/google.golang.org/protobuf/internal/impl/validate.go
generated
vendored
26
vendor/google.golang.org/protobuf/internal/impl/validate.go
generated
vendored
@@ -68,9 +68,13 @@ func Validate(mt protoreflect.MessageType, in protoiface.UnmarshalInput) (out pr
|
||||
if in.Resolver == nil {
|
||||
in.Resolver = protoregistry.GlobalTypes
|
||||
}
|
||||
if in.Depth == 0 {
|
||||
in.Depth = protowire.DefaultRecursionLimit
|
||||
}
|
||||
o, st := mi.validate(in.Buf, 0, unmarshalOptions{
|
||||
flags: in.Flags,
|
||||
resolver: in.Resolver,
|
||||
depth: in.Depth,
|
||||
})
|
||||
if o.initialized {
|
||||
out.Flags |= protoiface.UnmarshalInitialized
|
||||
@@ -257,6 +261,9 @@ func (mi *MessageInfo) validate(b []byte, groupTag protowire.Number, opts unmars
|
||||
states[0].typ = validationTypeGroup
|
||||
states[0].endGroup = groupTag
|
||||
}
|
||||
if opts.depth--; opts.depth < 0 {
|
||||
return out, ValidationInvalid
|
||||
}
|
||||
initialized := true
|
||||
start := len(b)
|
||||
State:
|
||||
@@ -451,6 +458,13 @@ State:
|
||||
mi: vi.mi,
|
||||
tail: b,
|
||||
})
|
||||
if vi.typ == validationTypeMessage ||
|
||||
vi.typ == validationTypeGroup ||
|
||||
vi.typ == validationTypeMap {
|
||||
if opts.depth--; opts.depth < 0 {
|
||||
return out, ValidationInvalid
|
||||
}
|
||||
}
|
||||
b = v
|
||||
continue State
|
||||
case validationTypeRepeatedVarint:
|
||||
@@ -499,6 +513,9 @@ State:
|
||||
mi: vi.mi,
|
||||
endGroup: num,
|
||||
})
|
||||
if opts.depth--; opts.depth < 0 {
|
||||
return out, ValidationInvalid
|
||||
}
|
||||
continue State
|
||||
case flags.ProtoLegacy && vi.typ == validationTypeMessageSetItem:
|
||||
typeid, v, n, err := messageset.ConsumeFieldValue(b, false)
|
||||
@@ -521,6 +538,13 @@ State:
|
||||
mi: xvi.mi,
|
||||
tail: b[n:],
|
||||
})
|
||||
if xvi.typ == validationTypeMessage ||
|
||||
xvi.typ == validationTypeGroup ||
|
||||
xvi.typ == validationTypeMap {
|
||||
if opts.depth--; opts.depth < 0 {
|
||||
return out, ValidationInvalid
|
||||
}
|
||||
}
|
||||
b = v
|
||||
continue State
|
||||
}
|
||||
@@ -547,12 +571,14 @@ State:
|
||||
switch st.typ {
|
||||
case validationTypeMessage, validationTypeGroup:
|
||||
numRequiredFields = int(st.mi.numRequiredFields)
|
||||
opts.depth++
|
||||
case validationTypeMap:
|
||||
// If this is a map field with a message value that contains
|
||||
// required fields, require that the value be present.
|
||||
if st.mi != nil && st.mi.numRequiredFields > 0 {
|
||||
numRequiredFields = 1
|
||||
}
|
||||
opts.depth++
|
||||
}
|
||||
// If there are more than 64 required fields, this check will
|
||||
// always fail and we will report that the message is potentially
|
||||
|
||||
Reference in New Issue
Block a user