Closed leo960 closed 4 years ago
Would you mind sending us a fix?
Besides @leo960 listed above, I think there are also some other code should be fix https://github.com/protocolbuffers/protobuf/blob/63e4a3ecc956cbab6714b25e8b868765ea7e6fe5/php/ext/google/protobuf/encode_decode.c#L76 https://github.com/protocolbuffers/protobuf/blob/63e4a3ecc956cbab6714b25e8b868765ea7e6fe5/php/ext/google/protobuf/encode_decode.c#L248 https://github.com/protocolbuffers/protobuf/blob/63e4a3ecc956cbab6714b25e8b868765ea7e6fe5/php/ext/google/protobuf/encode_decode.c#L359 https://github.com/protocolbuffers/protobuf/blob/63e4a3ecc956cbab6714b25e8b868765ea7e6fe5/php/ext/google/protobuf/encode_decode.c#L768
And Adding assertion after malloc
may make the code more strong.
Hi, @TeBoring It seems @leo960 doesn't have enough time to fix this issue. I am happy to give this issue a shot~~
Thanks for your help!
On Mon, Aug 26, 2019 at 19:21 Wang Qilin notifications@github.com wrote:
Hi, @TeBoring https://github.com/TeBoring It seems @leo960 https://github.com/leo960 doesn't have enough time to fix this issue. I am happy to give this issue a shot~~
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/protocolbuffers/protobuf/issues/6548?email_source=notifications&email_token=ABHUPZJNNFMZDD3ECRFDCHTQGSFSXA5CNFSM4IOR3CA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5GIBSY#issuecomment-525107403, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHUPZM3X6O52O63QO4X5I3QGSFSXANCNFSM4IOR3CAQ .
When I go through the source code, I found that there's no failure check after using malloc() and which may lead to crash. So I suggest that the following cases should add some checks for NULL: