Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static const Int CHANNELS_FOURPLEX[4][1];
- static const Int CHANNELS_EIGHTPLEX[8][1];
- ExitCodes main_(int, const char **)
- {
- ....
- if (itraq_type == ItraqQuantifier::FOURPLEX)
- {
- for (Size i = 0; i < 4; ++i)
- {
- std::vector<std::pair<String, DoubleReal> > one_label;
- one_label.push_back(std::make_pair<String, DoubleReal>(
- String("Channel ") +
- String(ItraqConstants::CHANNELS_FOURPLEX[i][0]),
- DoubleReal(ItraqConstants::CHANNELS_FOURPLEX[i][0])));
- labels.push_back(one_label);
- }
- }
- else //ItraqQuantifier::EIGHTPLEX
- {
- for (Size i = 0; i < 8; ++i)
- {
- std::vector<std::pair<String, DoubleReal> > one_label;
- one_label.push_back(std::make_pair<String, DoubleReal>(
- String("Channel ") +
- String(ItraqConstants::CHANNELS_FOURPLEX[i][0]),
- DoubleReal(ItraqConstants::CHANNELS_FOURPLEX[i][0])));
- labels.push_back(one_label);
- }
- }
- ....
- }
- This suspicious code was found in OpenMS project by PVS-Studio static code analyzer.
- Warning message is:
- V557 Array overrun is possible. The value of 'i' index could reach 7. itraqanalyzer.c 232
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment