This is an archive of the discontinued LLVM Phabricator instance.

Fix crash on parsing gdb remote packets
ClosedPublic

Authored by cbook on Aug 11 2017, 9:42 AM.

Details

Summary

Prevent negative chars from being sign-extended into isprint and isspace which take and int and crash if the int is negative.

Diff Detail

Event Timeline

cbook created this revision.Aug 11 2017, 9:42 AM

This looks good, the documentation for isprint() say that the value of the argument must be representable as an unsigned char, or EOF.

cbook added a comment.Aug 16 2017, 6:54 PM

Thanks Jason. I don't have commit access. Would you or someone else be able to commit this?

jasonmolenda accepted this revision.Aug 18 2017, 3:59 PM
This revision is now accepted and ready to land.Aug 18 2017, 3:59 PM
jasonmolenda closed this revision.Aug 18 2017, 3:59 PM

Sending source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
Transmitting file data .done
Committing transaction...
Committed revision 311207.

We need a test for this to ensure we don't regress.