forked from github/server
CID 22436 Ignoring number of bytes read
This commit is contained in:
parent
731dac3363
commit
3fe7b94cc7
1 changed files with 2 additions and 2 deletions
|
@ -1409,8 +1409,8 @@ int readgame(const char *filename, bool backup)
|
||||||
fread(&gdata.version, sizeof(int), 1, F);
|
fread(&gdata.version, sizeof(int), 1, F);
|
||||||
if (gdata.version >= INTPAK_VERSION) {
|
if (gdata.version >= INTPAK_VERSION) {
|
||||||
int stream_version;
|
int stream_version;
|
||||||
fread(&stream_version, sizeof(int), 1, F);
|
size_t sz = fread(&stream_version, sizeof(int), 1, F);
|
||||||
assert(stream_version == STREAM_VERSION || !"unsupported data format");
|
assert((sz==1 && stream_version == STREAM_VERSION) || !"unsupported data format");
|
||||||
}
|
}
|
||||||
assert(gdata.version >= MIN_VERSION || !"unsupported data format");
|
assert(gdata.version >= MIN_VERSION || !"unsupported data format");
|
||||||
assert(gdata.version <= MAX_VERSION || !"unsupported data format");
|
assert(gdata.version <= MAX_VERSION || !"unsupported data format");
|
||||||
|
|
Loading…
Reference in a new issue