(svn r19741) [1.0] -Backport from trunk:

- Fix: Crash when using restart via rcon (r19722)                                                                   
- Fix: Leaking a file descriptor [FS#3785] (r19695)                                                 
- Fix: Crash when the music/graphics metadata files were unreadable [FS#3774] (r19674)
This commit is contained in:
rubidium 2010-04-30 21:01:21 +00:00
parent b62a1ad1d5
commit 233ff7cacd
14 changed files with 52 additions and 33 deletions

View File

@ -1,3 +1,10 @@
1.0.1 (2010-05-01)
------------------------------------------------------------------------
- Fix: Crash when using restart via rcon (r19722)
- Fix: Leaking a file descriptor [CVE-2010-0406] [FS#3785] (r19695)
- Fix: Crash when the music/graphics metadata files were unreadable [FS#3774] (r19674)
1.0.1-RC2 (2010-04-22)
------------------------------------------------------------------------
- Fix: Desync when joining the game because of using the wrong variable (r19687)
@ -16,7 +23,7 @@
- Change: Sync Debian packaging updates from Debian, but keep building a single package (r19572)
- Fix: Crash of a dedicated server if the null blitter is overridden and (after a while) there is no company 0 on new year anymore [FS#3749] (r19664)
- Fix: In rare cases, update of signals could be missed (r19663)
- Fix: Various improvements of command handling, missing error messages (r19658, r19657, r19656, r19655, r19654, r19637, r19633, r19621, r19616, r19605, r19604)
- Fix: Various improvements of command handling, missing error messages, improper validation causing crashes [CVE-2010-0402] [FS#3748] (r19658, r19657, r19656, r19655, r19654, r19637, r19633, r19621, r19616, r19605, r19604)
- Fix: Industry generation failed for large maps and lots of industry types (r19652, r19643)
- Fix: When a company is sold, move connected clients to spectators [FS#3745] (r19651)
- Fix: A client would not be properly moved when moved while joining, e.g. when entering a company's password. This caused the client to be in the wrong company (according to the rest of the clients) and the client being kicked on the first command [FS#3760] (r19648)
@ -28,7 +35,7 @@
- Fix: Company related graphs were not updated correctly after changing the company colour [FS#3763] (r19615)
- Fix: Possible invalid read when server moves client to spectators before he finishes joining [FS#3755] (r19613)
- Fix: Crash when opening a savegame with a waypoint from around 0.4.0 [FS#3756] (r19612)
- Fix: Improve joining behaviour; kicking clients when entering passwords that was just cleared, 'connection lost' for people failing the password (r19610, r19609, r19608, r19607, r19606)
- Fix: Improve joining behaviour; kicking clients when entering passwords that was just cleared, 'connection lost' for people failing the password, access restriction circumvention [CVE-2010-0401] [FS#3754] (r19610, r19609, r19608, r19607, r19606)
- Fix: Desync debugging; false positives in the cache validity checks and saving/loading the command stream (r19619, r19617, r19602, r19601, r19600, r19596, r19593, r19592, r19589, r19587, r19586)
- Fix: Presence of online content was not properly updated after download due to duplicate slashes in the path (r19600)
- Fix: [NewGRF] Setting industry prop 0x24 to 0 caused empty station names (r19590)

View File

@ -1,6 +1,6 @@
OpenTTD's known bugs
Last updated: 2010-04-21
Release version: 1.0.1-RC2
Last updated: 2010-05-01
Release version: 1.0.1
------------------------------------------------------------------------

View File

@ -1,3 +1,9 @@
openttd (1.0.1-0) unstable; urgency=low
* New upstream release 1.0.1
-- Matthijs Kooijman <matthijs@stdin.nl> Sat, 01 May 2010 00:00:00 +0200
openttd (1.0.1~rc2-0) unstable; urgency=low
* New upstream release 1.0.1-RC2

View File

@ -1,6 +1,6 @@
@echo off
set OPENTTD_VERSION=1.0.0
set OPENTTD_VERSION=1.0.1
set OPENSFX_VERSION=0.8.0
set NOSOUND_VERSION=0.8.0
set OPENGFX_VERSION=0.7.0

View File

@ -2,8 +2,8 @@
!define APPV_MAJOR 1
!define APPV_MINOR 0
!define APPV_MAINT 1
!define APPV_BUILD 1
!define APPV_EXTRA "-RC2"
!define APPV_BUILD 2
!define APPV_EXTRA ""
!define APPNAME "OpenTTD" ; Define application name
!define APPVERSION "${APPV_MAJOR}.${APPV_MINOR}.${APPV_MAINT}${APPV_EXTRA}" ; Define application version

View File

@ -1,6 +1,6 @@
OpenTTD README
Last updated: 2010-04-21
Release version: 1.0.1-RC2
Last updated: 2010-05-01
Release version: 1.0.1
------------------------------------------------------------------------

View File

@ -108,10 +108,11 @@ struct BaseSet {
* Read the set information from a loaded ini.
* @param ini the ini to read from
* @param path the path to this ini file (for filenames)
* @param full_filename the full filename of the loaded file (for error reporting purposes)
* @param allow_empty_filename empty filenames are valid
* @return true if loading was successful.
*/
bool FillSetDetails(IniFile *ini, const char *path, bool allow_empty_filename = true);
bool FillSetDetails(IniFile *ini, const char *path, const char *full_filename, bool allow_empty_filename = true);
/**
* Get the description for the given ISO code.
@ -238,7 +239,7 @@ enum GraphicsFileType {
struct GraphicsSet : BaseSet<GraphicsSet, MAX_GFT, DATA_DIR> {
PaletteType palette; ///< Palette of this graphics set
bool FillSetDetails(struct IniFile *ini, const char *path);
bool FillSetDetails(struct IniFile *ini, const char *path, const char *full_filename);
};
/** All data/functions related with replacing the base graphics. */
@ -276,7 +277,7 @@ struct MusicSet : BaseSet<MusicSet, NUM_SONGS_AVAILABLE, GM_DIR> {
byte track_nr[NUM_SONGS_AVAILABLE];
byte num_available;
bool FillSetDetails(struct IniFile *ini, const char *path);
bool FillSetDetails(struct IniFile *ini, const char *path, const char *full_filename);
};
/** All data/functions related with replacing the base music */

View File

@ -25,12 +25,13 @@ template <class Tbase_set> /* static */ Tbase_set *BaseMedia<Tbase_set>::availab
#define fetch_metadata(name) \
item = metadata->GetItem(name, false); \
if (item == NULL || StrEmpty(item->value)) { \
DEBUG(grf, 0, "Base " SET_TYPE "set detail loading: %s field missing", name); \
DEBUG(grf, 0, "Base " SET_TYPE "set detail loading: %s field missing.", name); \
DEBUG(grf, 0, " Is %s readable for the user running OpenTTD?", full_filename); \
return false; \
}
template <class T, size_t Tnum_files, Subdirectory Tsubdir>
bool BaseSet<T, Tnum_files, Tsubdir>::FillSetDetails(IniFile *ini, const char *path, bool allow_empty_filename)
bool BaseSet<T, Tnum_files, Tsubdir>::FillSetDetails(IniFile *ini, const char *path, const char *full_filename, bool allow_empty_filename)
{
memset(this, 0, sizeof(*this));
@ -70,7 +71,7 @@ bool BaseSet<T, Tnum_files, Tsubdir>::FillSetDetails(IniFile *ini, const char *p
/* Find the filename first. */
item = files->GetItem(BaseSet<T, Tnum_files, Tsubdir>::file_names[i], false);
if (item == NULL || (item->value == NULL && !allow_empty_filename)) {
DEBUG(grf, 0, "No " SET_TYPE " file for: %s", BaseSet<T, Tnum_files, Tsubdir>::file_names[i]);
DEBUG(grf, 0, "No " SET_TYPE " file for: %s (in %s)", BaseSet<T, Tnum_files, Tsubdir>::file_names[i], full_filename);
return false;
}
@ -88,7 +89,7 @@ bool BaseSet<T, Tnum_files, Tsubdir>::FillSetDetails(IniFile *ini, const char *p
/* Then find the MD5 checksum */
item = md5s->GetItem(filename, false);
if (item == NULL) {
DEBUG(grf, 0, "No MD5 checksum specified for: %s", filename);
DEBUG(grf, 0, "No MD5 checksum specified for: %s (in %s)", filename, full_filename);
return false;
}
char *c = item->value;
@ -101,7 +102,7 @@ bool BaseSet<T, Tnum_files, Tsubdir>::FillSetDetails(IniFile *ini, const char *p
} else if ('A' <= *c && *c <= 'F') {
j = *c - 'A' + 10;
} else {
DEBUG(grf, 0, "Malformed MD5 checksum specified for: %s", filename);
DEBUG(grf, 0, "Malformed MD5 checksum specified for: %s (in %s)", filename, full_filename);
return false;
}
if (i % 2 == 0) {
@ -155,7 +156,7 @@ bool BaseMedia<Tbase_set>::AddFile(const char *filename, size_t basepath_length)
*path = '\0';
}
if (set->FillSetDetails(ini, path)) {
if (set->FillSetDetails(ini, path, filename)) {
Tbase_set *duplicate = NULL;
for (Tbase_set *c = BaseMedia<Tbase_set>::available_sets; c != NULL; c = c->next) {
if (strcmp(c->name, set->name) == 0 || c->shortname == set->shortname) {

View File

@ -989,7 +989,7 @@ DEF_CONSOLE_CMD(ConRestart)
/* Don't copy the _newgame pointers to the real pointers, so call SwitchToMode directly */
_settings_game.game_creation.map_x = MapLogX();
_settings_game.game_creation.map_y = FindFirstBit(MapSizeY());
SwitchToMode(SM_RESTARTGAME);
_switch_mode = SM_RESTARTGAME;
return true;
}

View File

@ -203,9 +203,9 @@ void GfxLoadSprites()
GfxInitPalettes();
}
bool GraphicsSet::FillSetDetails(IniFile *ini, const char *path)
bool GraphicsSet::FillSetDetails(IniFile *ini, const char *path, const char *full_filename)
{
bool ret = this->BaseSet<GraphicsSet, MAX_GFT, DATA_DIR>::FillSetDetails(ini, path, false);
bool ret = this->BaseSet<GraphicsSet, MAX_GFT, DATA_DIR>::FillSetDetails(ini, path, full_filename, false);
if (ret) {
IniGroup *metadata = ini->GetGroup("metadata");
IniItem *item;
@ -213,7 +213,7 @@ bool GraphicsSet::FillSetDetails(IniFile *ini, const char *path)
fetch_metadata("palette");
this->palette = (*item->value == 'D' || *item->value == 'd') ? PAL_DOS : PAL_WINDOWS;
}
return true;
return ret;
}

View File

@ -57,9 +57,9 @@ template <class Tbase_set>
return BaseMedia<Tbase_set>::used_set != NULL;
}
bool MusicSet::FillSetDetails(IniFile *ini, const char *path)
bool MusicSet::FillSetDetails(IniFile *ini, const char *path, const char *full_filename)
{
bool ret = this->BaseSet<MusicSet, NUM_SONGS_AVAILABLE, GM_DIR>::FillSetDetails(ini, path);
bool ret = this->BaseSet<MusicSet, NUM_SONGS_AVAILABLE, GM_DIR>::FillSetDetails(ini, path, full_filename);
if (ret) {
this->num_available = 0;
IniGroup *names = ini->GetGroup("names");
@ -93,5 +93,5 @@ bool MusicSet::FillSetDetails(IniFile *ini, const char *path)
this->num_available++;
}
}
return true;
return ret;
}

View File

@ -322,7 +322,7 @@ DEF_SERVER_SEND_COMMAND(PACKET_SERVER_MAP)
* nothing
*/
static FILE *file_pointer;
static FILE *file_pointer = NULL;
static uint sent_packets; // How many packets we did send succecfully last time
if (cs->status < STATUS_AUTHORIZED) {
@ -337,9 +337,12 @@ DEF_SERVER_SEND_COMMAND(PACKET_SERVER_MAP)
/* Make a dump of the current game */
if (SaveOrLoad(filename, SL_SAVE, AUTOSAVE_DIR) != SL_OK) usererror("network savedump failed");
file_pointer = FioFOpenFile(filename, "rb", AUTOSAVE_DIR);
fseek(file_pointer, 0, SEEK_END);
if (file_pointer != NULL) fclose(file_pointer);
file_pointer = FioFOpenFile(filename, "rb", AUTOSAVE_DIR);
if (file_pointer == NULL) usererror("network savedump failed - could not open just saved dump");
fseek(file_pointer, 0, SEEK_END);
if (ftell(file_pointer) == 0) usererror("network savedump failed - zero sized savegame?");
/* Now send the _frame_counter and how many packets are coming */
@ -382,6 +385,7 @@ DEF_SERVER_SEND_COMMAND(PACKET_SERVER_MAP)
* to send it is ready (maybe that happens like never ;)) */
cs->status = STATUS_DONE_MAP;
fclose(file_pointer);
file_pointer = NULL;
NetworkClientSocket *new_cs;
bool new_map_client = false;

View File

@ -73,7 +73,7 @@ void MoveWaypointsToBaseStations()
if (wp->delete_ctr != 0) continue; // The waypoint was deleted
/* Waypoint indices were not added to the map prior to this. */
_m[wp->xy].m2 = wp->index;
_m[wp->xy].m2 = (StationID)wp->index;
if (HasBit(_m[wp->xy].m3, 4)) {
wp->spec = GetCustomStationSpec(STAT_CLASS_WAYP, _m[wp->xy].m4 + 1);

View File

@ -41,10 +41,10 @@ enum TreeType {
* got two types of area, one for normal trees and one only for cacti.
*/
enum {
TREE_COUNT_TEMPERATE = TREE_SUB_ARCTIC - TREE_TEMPERATE, ///< number of treetypes on a temperate map
TREE_COUNT_SUB_ARCTIC = TREE_RAINFOREST - TREE_SUB_ARCTIC, ///< number of treetypes on a sub arctic map
TREE_COUNT_RAINFOREST = TREE_CACTUS - TREE_RAINFOREST, ///< number of treetypes for the 'green part' of a sub tropic map
TREE_COUNT_SUB_TROPICAL = TREE_SUB_TROPICAL - TREE_CACTUS, ///< number of treetypes for the 'desert part' of a sub tropic map
TREE_COUNT_TEMPERATE = TREE_SUB_ARCTIC - TREE_TEMPERATE, ///< number of treetypes on a temperate map
TREE_COUNT_SUB_ARCTIC = TREE_RAINFOREST - TREE_SUB_ARCTIC, ///< number of treetypes on a sub arctic map
TREE_COUNT_RAINFOREST = TREE_CACTUS - TREE_RAINFOREST, ///< number of treetypes for the 'rainforrest part' of a sub-tropic map
TREE_COUNT_SUB_TROPICAL = TREE_TOYLAND - TREE_SUB_TROPICAL, ///< number of treetypes for the 'sub-tropic part' of a sub-tropic map
TREE_COUNT_TOYLAND = 9 ///< number of treetypes on a toyland map
};