diff --git a/changelog.txt b/changelog.txt index 4eca3e36f9..b280762384 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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) diff --git a/known-bugs.txt b/known-bugs.txt index f4ac389157..65f9c7530f 100644 --- a/known-bugs.txt +++ b/known-bugs.txt @@ -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 ------------------------------------------------------------------------ diff --git a/os/debian/changelog b/os/debian/changelog index f37f60dd9d..c836a51f78 100644 --- a/os/debian/changelog +++ b/os/debian/changelog @@ -1,3 +1,9 @@ +openttd (1.0.1-0) unstable; urgency=low + + * New upstream release 1.0.1 + + -- Matthijs Kooijman Sat, 01 May 2010 00:00:00 +0200 + openttd (1.0.1~rc2-0) unstable; urgency=low * New upstream release 1.0.1-RC2 diff --git a/os/os2/installer/make_installer.cmd b/os/os2/installer/make_installer.cmd index 708eb2d405..500ef2b0b1 100644 --- a/os/os2/installer/make_installer.cmd +++ b/os/os2/installer/make_installer.cmd @@ -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 diff --git a/os/windows/installer/install.nsi b/os/windows/installer/install.nsi index 63ff47a71f..ea60752e12 100644 --- a/os/windows/installer/install.nsi +++ b/os/windows/installer/install.nsi @@ -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 diff --git a/readme.txt b/readme.txt index bb85138c70..77aad0ddab 100644 --- a/readme.txt +++ b/readme.txt @@ -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 ------------------------------------------------------------------------ diff --git a/src/base_media_base.h b/src/base_media_base.h index 88b78374b4..4cf5ed8ede 100644 --- a/src/base_media_base.h +++ b/src/base_media_base.h @@ -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 { 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 { 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 */ diff --git a/src/base_media_func.h b/src/base_media_func.h index aa339452c6..a6071f4f04 100644 --- a/src/base_media_func.h +++ b/src/base_media_func.h @@ -25,12 +25,13 @@ template /* static */ Tbase_set *BaseMedia::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 -bool BaseSet::FillSetDetails(IniFile *ini, const char *path, bool allow_empty_filename) +bool BaseSet::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::FillSetDetails(IniFile *ini, const char *p /* Find the filename first. */ item = files->GetItem(BaseSet::file_names[i], false); if (item == NULL || (item->value == NULL && !allow_empty_filename)) { - DEBUG(grf, 0, "No " SET_TYPE " file for: %s", BaseSet::file_names[i]); + DEBUG(grf, 0, "No " SET_TYPE " file for: %s (in %s)", BaseSet::file_names[i], full_filename); return false; } @@ -88,7 +89,7 @@ bool BaseSet::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::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::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::available_sets; c != NULL; c = c->next) { if (strcmp(c->name, set->name) == 0 || c->shortname == set->shortname) { diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 72df91641d..d44fe028ae 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -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; } diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp index f2678ae093..998ba3128a 100644 --- a/src/gfxinit.cpp +++ b/src/gfxinit.cpp @@ -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::FillSetDetails(ini, path, false); + bool ret = this->BaseSet::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; } diff --git a/src/music.cpp b/src/music.cpp index c4f15cc396..a6c8ea78f7 100644 --- a/src/music.cpp +++ b/src/music.cpp @@ -57,9 +57,9 @@ template return BaseMedia::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::FillSetDetails(ini, path); + bool ret = this->BaseSet::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; } diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 6fdcf9ff8f..4dfa05df41 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -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; diff --git a/src/saveload/waypoint_sl.cpp b/src/saveload/waypoint_sl.cpp index ae5c36ac18..e82f7e26ec 100644 --- a/src/saveload/waypoint_sl.cpp +++ b/src/saveload/waypoint_sl.cpp @@ -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); diff --git a/src/tree_map.h b/src/tree_map.h index 840517218f..dbd905fff9 100644 --- a/src/tree_map.h +++ b/src/tree_map.h @@ -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 };