Commit 1a87ac20 authored by nanahira's avatar nanahira

use lesser deck_size check in UPDATE_DECK

parent 1744807c
Pipeline #27519 failed with stages
in 2 minutes and 4 seconds
......@@ -402,7 +402,12 @@ void SingleDuel::UpdateDeck(DuelPlayer* dp, unsigned char* pdata, int len) {
valid = false;
else if (sidec < 0 || sidec > SIDEC_MAX)
valid = false;
else if (deck_size != (mainc + sidec) * (int)sizeof(int32_t))
else if
#ifdef YGOPRO_SERVER_MODE
(deck_size < (mainc + sidec) * (int)sizeof(int32_t) || deck_size > MAINC_MAX + SIDEC_MAX)
#else
(deck_size != (mainc + sidec) * (int)sizeof(int32_t))
#endif
valid = false;
if (!valid) {
STOC_ErrorMsg scem;
......
......@@ -388,7 +388,13 @@ void TagDuel::UpdateDeck(DuelPlayer* dp, unsigned char* pdata, int len) {
valid = false;
else if (sidec < 0 || sidec > SIDEC_MAX)
valid = false;
else if (deck_size != (mainc + sidec) * (int)sizeof(int32_t))
else if
#ifdef YGOPRO_SERVER_MODE
(deck_size < (mainc + sidec) * (int)sizeof(int32_t) || deck_size > MAINC_MAX + SIDEC_MAX)
#else
(deck_size != (mainc + sidec) * (int)sizeof(int32_t))
#endif
(mainc + sidec) * (int)sizeof(int32_t))
valid = false;
if (!valid) {
STOC_ErrorMsg scem;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment