mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-04-04 09:47:02 +00:00
fixed a potential buffer overflow in loadsave()
This commit is contained in:
parent
83943bb968
commit
4a8e3285c7
@ -1132,7 +1132,7 @@ EX void loadsave() {
|
||||
char buf1[80], ver[10];
|
||||
int tid, land, score, tc, t, ts, cert;
|
||||
int xc = -1;
|
||||
sscanf(buf, "%70s%10s%d%d%d%d%d%d%d%d",
|
||||
sscanf(buf, "%70s%9s%d%d%d%d%d%d%d%d",
|
||||
buf1, ver, &tid, &land, &score, &tc, &t, &ts, &cert, &xc);
|
||||
|
||||
eLand l2 = eLand(land);
|
||||
@ -1156,7 +1156,7 @@ EX void loadsave() {
|
||||
if(buf[0] == 'Y' && buf[1] == 'E' && buf[2] == 'N') {
|
||||
char buf1[80], ver[10];
|
||||
int cid, oy, won, tc, t, ts, cert=0, xc = -1;
|
||||
sscanf(buf, "%70s%10s%d%d%d%d%d%d%d%d",
|
||||
sscanf(buf, "%70s%9s%d%d%d%d%d%d%d%d",
|
||||
buf1, ver, &cid, &oy, &won, &tc, &t, &ts, &cert, &xc);
|
||||
|
||||
if(xc == -1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user