Skip to content

Commit 0ccb835

Browse files
committed
net: Keep TMessage to 32 bits (no real enforcement yet)
1 parent 8dc3a46 commit 0ccb835

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

net/net/src/TMessage.cxx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,16 @@ Int_t TMessage::Compress()
392392
fCompPos = fBufCur;
393393

394394
bufcur = fBufComp;
395+
if (CompLength() > static_cast<Int_t>(std::numeric_limits<UInt_t>::max())) {
396+
Warning("Compress", "Compressed buffer length too large (%d)", CompLength());
397+
}
395398
tobuf(bufcur, (UInt_t)(CompLength() - sizeof(UInt_t)));
396399
Int_t what = fWhat | kMESS_ZIP;
397400
tobuf(bufcur, what);
398-
tobuf(bufcur, Length()); // original uncompressed buffer length
401+
if (Length() > static_cast<Int_t>(std::numeric_limits<UInt_t>::max())) {
402+
Warning("Compress", "Original buffer length too large (%lld)", Length());
403+
}
404+
tobuf(bufcur, (UInt_t)Length()); // original uncompressed buffer length
399405

400406
return 0;
401407
}

0 commit comments

Comments
 (0)