Skip to content

Commit

Permalink
[XrdOss] Fix CodeQL warning about int overflow in multiplication
Browse files Browse the repository at this point in the history
The multiplication is numq * xfrovhd, which if carried with ints
can overflow before being converted to unsigned long long. Convert
one of the operands to unsigned long long to avoid this.
  • Loading branch information
amadio committed Nov 26, 2024
1 parent 00b0ba5 commit e1349ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/XrdOss/XrdOssStage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,9 @@ int XrdOssSys::CalcTime()

int XrdOssSys::CalcTime(XrdOssStage_Req *req) // StageMutex lock held!
{
unsigned long long numq = 1;
unsigned long long tbytes = req->size + stgbytes/2;
int xfrtime, numq = 1;
int xfrtime;
time_t now;
XrdOssStage_Req *rqp = req;

Expand Down

0 comments on commit e1349ec

Please sign in to comment.