From bc743ca7ced997e75ee72b8f493f6ffb14879aad Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Wed, 4 Jan 2012 00:37:46 +0200 Subject: Add missing checks to texture caching --- src/server.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/server.cpp') diff --git a/src/server.cpp b/src/server.cpp index 8bf9eee38..d1a71bdbc 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -4273,6 +4273,12 @@ void Server::PrepareTextures() { if(dirlist[j].dir) // Ignode dirs continue; std::string tname = dirlist[j].name; + // if name contains illegal characters, ignore the texture + if(!string_allowed(tname, TEXTURENAME_ALLOWED_CHARS)){ + errorstream<<"Server: ignoring illegal texture name: \"" + < texture_announcements; @@ -4407,6 +4418,11 @@ void Server::SendTexturesRequested(u16 peer_id,core::list tosend u32 texture_size_bunch_total = 0; for(core::list::Iterator i = tosend.begin(); i != tosend.end(); i++) { + if(m_Textures.find(i->name) == m_Textures.end()){ + errorstream<<"Server::SendTexturesRequested(): Client asked for " + <<"unknown texture \""<<(i->name)<<"\""<