diff options
author | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2006-03-01 09:43:27 +0000 |
---|---|---|
committer | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2006-03-01 09:43:27 +0000 |
commit | a249b69fa96755f72599abecb66d48c32fdfeb38 (patch) | |
tree | f7b9a8260732484fb6ec27eb554e6dc74d074b1c | |
parent | 910a99d28482b7953ac87a18fab5085f50231b3c (diff) |
BUILD : 1.7.13 (974) BUGS : 454 NOTES : Fixed a crash when passing a NULL-user to moduleGetLangString
git-svn-id: svn://svn.anope.org/anope/trunk@974 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@699 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | Changes | 1 | ||||
-rw-r--r-- | src/modules.c | 8 | ||||
-rw-r--r-- | version.log | 6 |
3 files changed, 11 insertions, 4 deletions
@@ -18,6 +18,7 @@ Provided by illu. <illu@rs2i.net> - 2006 01/25 F Updated the french language file. [ #00] Provided by Trystan <trystan@nomadirc.net> - 2006 +03/01 F Crash when not giving user for moduleGetLangString. [#454] 02/23 F Usermatching possible null arg on sstrdup. [ #00] 02/12 F Double unbanning of in certain conditions. [ #00] 01/25 F va_copy issue for various platforms. [ #00] diff --git a/src/modules.c b/src/modules.c index 8c37fb61c..4201fb6a4 100644 --- a/src/modules.c +++ b/src/modules.c @@ -2564,7 +2564,7 @@ char *moduleGetLangString(User * u, int number) mod_current_module = findModule(mod_current_module_name); /* Find the users lang, and use it if we can */ - if (u->na && u->na->nc) + if (u && u->na && u->na->nc) lang = u->na->nc->language; /* If the users lang isnt supported, drop back to English */ @@ -2572,14 +2572,16 @@ char *moduleGetLangString(User * u, int number) lang = LANG_EN_US; /* If the requested lang string exists for the language */ - if (mod_current_module->lang[lang].argc > number) + if (mod_current_module->lang[lang].argc > number) { return mod_current_module->lang[lang].argv[number]; /* Return an empty string otherwise, because we might be used without * the return value being checked. If we would return NULL, bad things * would happen! */ - else + } else { + alog("%s: INVALID language string call, language: [%d], String [%d]", mod_current_module->name, lang, number); return ""; + } } /** diff --git a/version.log b/version.log index a758434a5..f4091b2da 100644 --- a/version.log +++ b/version.log @@ -9,10 +9,14 @@ VERSION_MAJOR="1" VERSION_MINOR="7" VERSION_PATCH="13" VERSION_EXTRA="-svn" -VERSION_BUILD="972" +VERSION_BUILD="974" # $Log$ # +# BUILD : 1.7.13 (974) +# BUGS : 454 +# NOTES : Fixed a crash when passing a NULL-user to moduleGetLangString +# # BUILD : 1.7.13 (972) # BUGS : # NOTES : Fixed a bug involving EVENT_ACCESS_DEL. |