Skip to content

Commit 5162c0b

Browse files
committed
Fixed UUValidator.ScanBeginMarker to always return false until Payload
1 parent 651cbef commit 5162c0b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

MimeKit/Encodings/UUValidator.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,15 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
153153
if (inptr == inend) {
154154
streamOffset += (int) (inptr - start);
155155
nsaved = *(inptr - 1);
156-
return true;
156+
return false;
157157
}
158158

159159
SkipByte (ref inptr);
160160

161161
streamOffset += (int) (inptr - start);
162162

163163
if (inptr == inend)
164-
return true;
164+
return false;
165165
}
166166

167167
nsaved = ReadByte (ref inptr);
@@ -177,7 +177,7 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
177177

178178
state = UUValidatorState.B;
179179
if (inptr == inend)
180-
return true;
180+
return false;
181181
}
182182

183183
if (state == UUValidatorState.B) {
@@ -189,7 +189,7 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
189189

190190
state = UUValidatorState.Be;
191191
if (inptr == inend)
192-
return true;
192+
return false;
193193
}
194194

195195
if (state == UUValidatorState.Be) {
@@ -201,7 +201,7 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
201201

202202
state = UUValidatorState.Beg;
203203
if (inptr == inend)
204-
return true;
204+
return false;
205205
}
206206

207207
if (state == UUValidatorState.Beg) {
@@ -213,7 +213,7 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
213213

214214
state = UUValidatorState.Begi;
215215
if (inptr == inend)
216-
return true;
216+
return false;
217217
}
218218

219219
if (state == UUValidatorState.Begi) {
@@ -225,7 +225,7 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
225225

226226
state = UUValidatorState.Begin;
227227
if (inptr == inend)
228-
return true;
228+
return false;
229229
}
230230

231231
if (state == UUValidatorState.Begin) {
@@ -239,7 +239,7 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
239239
nsaved = 0;
240240

241241
if (inptr == inend)
242-
return true;
242+
return false;
243243
}
244244

245245
if (state == UUValidatorState.FileMode) {
@@ -257,7 +257,7 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
257257
}
258258

259259
if (inptr == inend)
260-
return true;
260+
return false;
261261

262262
if (nsaved < 3) {
263263
// file mode is too short
@@ -276,7 +276,7 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
276276
nsaved = 0;
277277

278278
if (inptr == inend)
279-
return true;
279+
return false;
280280
}
281281

282282
if (state == UUValidatorState.FileName) {
@@ -301,7 +301,7 @@ unsafe bool ScanBeginMarker (ref byte* inptr, byte* inend)
301301
}
302302
}
303303

304-
return true;
304+
return false;
305305
}
306306

307307
#if NET6_0_OR_GREATER

0 commit comments

Comments
 (0)