Skip to content

Commit 423b1e1

Browse files
committed
HPCC-36035 Remove coverity-flagged overflows
Unlikely to cause a serious problem, but switched to use dedicated for loop indices to avoid overflow/underflow or misuse after loop ends. - CFragmentedXmlPullParser::next - Cws_machineEx::setProcessRequest Signed-off-by: Terrence Asselin <terrence.asselin+copilot@lexisnexisrisk.com>
1 parent b5dbe52 commit 423b1e1

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

esp/bindings/SOAP/xpp/fxpp/FragmentedXmlPullParser.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,12 @@ class CFragmentedXmlPullParser : public IFragmentedXmlPullParser
216216
}
217217
else
218218
{
219-
do
219+
for (uint8_t i=0; i<=laIndex; ++i)
220220
{
221-
la = peekDataFrame(laIndex);
221+
la = peekDataFrame(i);
222222
if (la)
223223
la->state = DataFrame::FrameIgnored;
224224
}
225-
while (laIndex-- != 0);
226225
pushFragment(injector.m_frame.getLink());
227226
}
228227
}

esp/services/ws_machine/ws_machineService.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ void Cws_machineEx::setProcessRequest(CGetMachineInfoData& machineInfoData, Bool
499499
processTypeStr = processType;
500500
}
501501

502-
while (numIps--)
502+
for (unsigned i=0; i<numIps; ++i)
503503
{
504504
unsigned numAddr;
505505
if (ipAddr.getNetAddress(sizeof(numAddr),&numAddr)!=sizeof(numAddr))

0 commit comments

Comments
 (0)