This is an archive of the discontinued LLVM Phabricator instance.

Fix crash when an invalid URI is parsed and error handling is attempted
ClosedPublic

Authored by crr0004 on Apr 4 2021, 10:33 PM.

Details

Summary

When you pass in a payload with an invalid URI in a build with assertions enabled, it will crash.
Consuming the error from the failed URI parse prevents the error.

The crash is caused by the llvm::expected having protection around trying to deconstruct without consuming the error first.

Diff Detail

Event Timeline

crr0004 created this revision.Apr 4 2021, 10:33 PM
crr0004 requested review of this revision.Apr 4 2021, 10:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 4 2021, 10:33 PM
crr0004 edited the summary of this revision. (Show Details)Apr 4 2021, 10:33 PM
kadircet accepted this revision.Apr 5 2021, 11:17 PM

thanks, lgtm! please provide an email for attribution if i should land this for you.

This revision is now accepted and ready to land.Apr 5 2021, 11:17 PM

thanks, lgtm! please provide an email for attribution if i should land this for you.

Great! I wasn't sure if I should create a unit test for it. I couldn't see a place where Protocol was being tested.

My email is crr0004@gmail.com