You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/base/src/TBuffer.cxx
+20-18Lines changed: 20 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -70,12 +70,12 @@ TBuffer::TBuffer(EMode mode)
70
70
/// Create an I/O buffer object. Mode should be either TBuffer::kRead or
71
71
/// TBuffer::kWrite.
72
72
73
-
TBuffer::TBuffer(EMode mode, Int_t bufsiz)
73
+
TBuffer::TBuffer(EMode mode, Long64_t bufsize)
74
74
{
75
-
if (bufsiz < 0)
76
-
Fatal("TBuffer","Request to create a buffer with a negative size, likely due to an integer overflow: 0x%x for a max of 0x%x.", bufsiz, kMaxBufferSize);
77
-
if (bufsiz < kMinimalSize) bufsiz = kMinimalSize;
78
-
fBufSize = bufsiz;
75
+
if (bufsize > kMaxBufferSize)
76
+
Fatal("TBuffer","Request to create a too large buffer: 0x%llx for a max of 0x%x.", bufsize, kMaxBufferSize);
77
+
if (bufsize < kMinimalSize) bufsize = kMinimalSize;
Fatal("TBuffer","Request to create a buffer with a negative size, likely due to an integer overflow: 0x%x for a max of 0x%x.", bufsiz, kMaxBufferSize);
108
-
fBufSize = bufsiz;
106
+
if (bufsize > kMaxBufferSize)
107
+
Fatal("TBuffer","Request to create a too large buffer: 0x%llx for a max of 0x%x.", bufsize, kMaxBufferSize);
108
+
fBufSize = bufsize;
109
109
fMode = mode;
110
110
fVersion = 0;
111
111
fParent = nullptr;
@@ -155,10 +155,10 @@ TBuffer::~TBuffer()
155
155
/// If the size_needed is larger than the current size, the policy
156
156
/// is to expand to double the current size or the size_needed which ever is largest.
157
157
158
-
voidTBuffer::AutoExpand(Int_t size_needed)
158
+
voidTBuffer::AutoExpand(Long64_t size_needed)
159
159
{
160
-
if (size_needed < 0) {
161
-
Fatal("AutoExpand","Request to expand to a negative size, likely due to an integer overflow: 0x%x for a max of 0x%x.", size_needed, kMaxBufferSize);
160
+
if (size_needed > kMaxBufferSize) {
161
+
Fatal("AutoExpand","Request to expand a too large buffer: 0x%llx for a max of 0x%x.", size_needed, kMaxBufferSize);
0 commit comments