mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 03:15:35 -04:00
network: forbid packets with length <= 0
This commit is contained in:
parent
4773311260
commit
3adc8d919e
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Minosoft
|
||||
* Copyright (C) 2020-2022 Moritz Zwerger
|
||||
* Copyright (C) 2020-2023 Moritz Zwerger
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
@ -37,7 +37,7 @@ class LengthDecoder(
|
||||
return
|
||||
}
|
||||
|
||||
if (length > maxLength) {
|
||||
if (length <= 0 || length > maxLength) {
|
||||
throw PacketTooLongException(length, maxLength)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user