This is an archive of the discontinued LLVM Phabricator instance.

fix array index out of bounds
ClosedPublic

Authored by danielmarjamaki on Jan 26 2016, 7:25 AM.

Details

Summary

This little patch fixes possible array index out of bounds:

[tools/clang/lib/Driver/MSVCToolChain.cpp:147]: (error) Array 'partialKey[256]' accessed at index 256, which is out of bounds

There is a slight change in behaviour now. If partialKey is filled with data then partialData[255] is zeroed instead of partialData[256]. I thought about making partialData one byte bigger so partialData[256]='\0' would be ok but I _think_ that it is 256 elements by intention.

Diff Detail

Repository
rL LLVM

Event Timeline

danielmarjamaki retitled this revision from to fix array index out of bounds.
danielmarjamaki updated this object.
danielmarjamaki set the repository for this revision to rL LLVM.
danielmarjamaki added a subscriber: cfe-commits.

adding reviewers according to 'svn blame' and CODE_OWNERS.txt

rnk accepted this revision.Jan 26 2016, 9:09 AM
rnk edited edge metadata.

lgtm

This code is old and super janky. =/

This revision is now accepted and ready to land.Jan 26 2016, 9:09 AM
This revision was automatically updated to reflect the committed changes.