Skip to content

Guard all Caffe2 protobuf string serializations with CAFFE_ENFORCE (fixed reverted bug)#12848

Closed
mike9ant wants to merge 1 commit intopytorch:masterfrom
mike9ant:export-D10453456
Closed

Guard all Caffe2 protobuf string serializations with CAFFE_ENFORCE (fixed reverted bug)#12848
mike9ant wants to merge 1 commit intopytorch:masterfrom
mike9ant:export-D10453456

Conversation

@mike9ant
Copy link
Copy Markdown
Contributor

Summary:
Updated all non-test uses of protobuf::MessageLite::SerializeAsString to call
SerializeAsString_EnforceCheck so that the return value is checked and can
throw an exception if failing.

Most of the affected code was called from classes derived from BlobSerializeBase.
Didn't touch most tests and ENFORCE calls because they usually do checks
anyway.

Original commit changeset: c0760e73ecc7

Differential Revision: D10453456

…ixed reverted bug) (pytorch#12848)

Summary:
Pull Request resolved: pytorch#12848

Updated all non-test uses of protobuf::MessageLite::SerializeAsString to call
SerializeAsString_EnforceCheck so that the return value is checked and can
throw an exception if failing.

Most of the affected code was called from classes derived from  BlobSerializeBase.
Didn't touch most tests and ENFORCE calls because they usually do checks
anyway.

Original commit changeset: c0760e73ecc7

Reviewed By: dzhulgakov

Differential Revision: D10453456

fbshipit-source-id: dabd3942d10f9192e5f4df628ed214a72fd939f0
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
…ixed reverted bug) (pytorch#12848)

Summary:
Pull Request resolved: pytorch#12848

Updated all non-test uses of protobuf::MessageLite::SerializeAsString to call
SerializeAsString_EnforceCheck so that the return value is checked and can
throw an exception if failing.

Most of the affected code was called from classes derived from  BlobSerializeBase.
Didn't touch most tests and ENFORCE calls because they usually do checks
anyway.

Original commit changeset: c0760e73ecc7

Reviewed By: dzhulgakov

Differential Revision: D10453456

fbshipit-source-id: d2f2b7b4578e721924354149f08f627c7e3bf070
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants