Commit 5c6ada99 authored by Chen Bill's avatar Chen Bill

check sizeof deckBuffer in LoadDeck

parent 44657e35
......@@ -280,8 +280,8 @@ bool DeckManager::LoadDeck(const wchar_t* file, bool is_packlist) {
}
if(!reader)
return false;
size_t size = reader->getSize();
if(size >= 0x20000) {
auto size = reader->getSize();
if(size >= (int)sizeof deckBuffer) {
reader->drop();
return false;
}
......@@ -296,7 +296,7 @@ bool DeckManager::LoadDeck(std::istringstream* deckStream, bool is_packlist) {
int cardlist[300];
bool is_side = false;
std::string linebuf;
while(std::getline(*deckStream, linebuf) && ct < 300) {
while(std::getline(*deckStream, linebuf, '\n') && ct < 300) {
if(linebuf[0] == '!') {
is_side = true;
continue;
......
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