Open VoroninArtemii opened 8 months ago
The condition will always be false, so the block will never be executed. Constant value: https://github.com/golang/protobuf/blob/5d5e8c018a13017f9d5b8bf4fad64aaa42a87308/proto/text_decode.go#L22 Blocks IF: https://github.com/golang/protobuf/blob/5d5e8c018a13017f9d5b8bf4fad64aaa42a87308/proto/text_decode.go#L33-L35 https://github.com/golang/protobuf/blob/5d5e8c018a13017f9d5b8bf4fad64aaa42a87308/proto/text_decode.go#L51-L59 And this case is in other file: https://github.com/golang/protobuf/blob/5d5e8c018a13017f9d5b8bf4fad64aaa42a87308/proto/text_encode.go#L23 https://github.com/golang/protobuf/blob/5d5e8c018a13017f9d5b8bf4fad64aaa42a87308/proto/text_encode.go#L54-L70 Similar case is in other files: https://github.com/golang/protobuf/blob/5d5e8c018a13017f9d5b8bf4fad64aaa42a87308/jsonpb/decode.go#L25 https://github.com/golang/protobuf/blob/5d5e8c018a13017f9d5b8bf4fad64aaa42a87308/jsonpb/decode.go#L97-L126 https://github.com/golang/protobuf/blob/5d5e8c018a13017f9d5b8bf4fad64aaa42a87308/jsonpb/encode.go#L26 https://github.com/golang/protobuf/blob/5d5e8c018a13017f9d5b8bf4fad64aaa42a87308/jsonpb/encode.go#L97-L108
Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE. Author A. Voronin.
The wrapTextUnmarshalV2 value is part of the Google-internal use of this package, and is not always false for them.
wrapTextUnmarshalV2
false
Since Google uses a duplicate of this code internally, there’s some things like this.
Issue Description
The condition will always be false, so the block will never be executed. Constant value: https://github.com/golang/protobuf/blob/5d5e8c018a13017f9d5b8bf4fad64aaa42a87308/proto/text_decode.go#L22 Blocks IF: https://github.com/golang/protobuf/blob/5d5e8c018a13017f9d5b8bf4fad64aaa42a87308/proto/text_decode.go#L33-L35 https://github.com/golang/protobuf/blob/5d5e8c018a13017f9d5b8bf4fad64aaa42a87308/proto/text_decode.go#L51-L59 And this case is in other file: https://github.com/golang/protobuf/blob/5d5e8c018a13017f9d5b8bf4fad64aaa42a87308/proto/text_encode.go#L23 https://github.com/golang/protobuf/blob/5d5e8c018a13017f9d5b8bf4fad64aaa42a87308/proto/text_encode.go#L54-L70 Similar case is in other files: https://github.com/golang/protobuf/blob/5d5e8c018a13017f9d5b8bf4fad64aaa42a87308/jsonpb/decode.go#L25 https://github.com/golang/protobuf/blob/5d5e8c018a13017f9d5b8bf4fad64aaa42a87308/jsonpb/decode.go#L97-L126 https://github.com/golang/protobuf/blob/5d5e8c018a13017f9d5b8bf4fad64aaa42a87308/jsonpb/encode.go#L26 https://github.com/golang/protobuf/blob/5d5e8c018a13017f9d5b8bf4fad64aaa42a87308/jsonpb/encode.go#L97-L108
Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE. Author A. Voronin.