Skip to content

Commit b03c65e

Browse files
skippy peanut butter
1 parent 550e889 commit b03c65e

File tree

74 files changed

+597
-1600
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+597
-1600
lines changed

plugin/unmarshal/unmarshal.go

+3-13
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ func (p *unmarshal) field(file *generator.FileDescriptor, msg *generator.Descrip
844844
p.P(`return err`)
845845
p.Out()
846846
p.P(`}`)
847-
p.P(`if skippy < 0 {`)
847+
p.P(`if (skippy < 0) || (iNdEx + skippy) < 0 {`)
848848
p.In()
849849
p.P(`return ErrInvalidLength`, p.localName)
850850
p.Out()
@@ -1484,12 +1484,7 @@ func (p *unmarshal) Generate(file *generator.FileDescriptor) {
14841484
p.P(`return err`)
14851485
p.Out()
14861486
p.P(`}`)
1487-
p.P(`if skippy < 0 {`)
1488-
p.In()
1489-
p.P(`return ErrInvalidLength`, p.localName)
1490-
p.Out()
1491-
p.P(`}`)
1492-
p.P(`if (iNdEx + skippy) < 0 {`)
1487+
p.P(`if (skippy < 0) || (iNdEx + skippy) < 0 {`)
14931488
p.In()
14941489
p.P(`return ErrInvalidLength`, p.localName)
14951490
p.Out()
@@ -1512,12 +1507,7 @@ func (p *unmarshal) Generate(file *generator.FileDescriptor) {
15121507
p.P(`return err`)
15131508
p.Out()
15141509
p.P(`}`)
1515-
p.P(`if skippy < 0 {`)
1516-
p.In()
1517-
p.P(`return ErrInvalidLength`, p.localName)
1518-
p.Out()
1519-
p.P(`}`)
1520-
p.P(`if (iNdEx + skippy) < 0 {`)
1510+
p.P(`if (skippy < 0) || (iNdEx + skippy) < 0 {`)
15211511
p.In()
15221512
p.P(`return ErrInvalidLength`, p.localName)
15231513
p.Out()

test/asymetric-issue125/asym.pb.go

+2-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/casttype/combos/both/casttype.pb.go

+6-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/casttype/combos/unmarshaler/casttype.pb.go

+6-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/castvalue/combos/both/castvalue.pb.go

+4-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/castvalue/combos/unmarshaler/castvalue.pb.go

+4-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)