From 31a40b28f80db477f4c9c4acf2a4ca0e496acb67 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 1 Dec 2006 00:34:10 +0000 Subject: [PATCH] fixed a potential crash in sscanf when reading new factions. --- src/common/modules/autoseed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/modules/autoseed.c b/src/common/modules/autoseed.c index 02699a165..82d83e991 100644 --- a/src/common/modules/autoseed.c +++ b/src/common/modules/autoseed.c @@ -197,7 +197,7 @@ read_newfactions(const char * filename) email[0] = '\0'; password[0] = '\0'; - sscanf(buf, "%s %s %s %d %d %s %d", email, race, lang, &bonus, &subscription, password, &alliance); + if (sscanf(buf, "%54s %20s %8s %d %d %16s %d", email, race, lang, &bonus, &subscription, password, &alliance)<6) break; if (email[0]=='\0') break; if (password[0]=='\0') { strcpy(password, itoa36(rng_int()));