From c424949dca82dc2c3cae3908a03df2ae1e77a5ee Mon Sep 17 00:00:00 2001 From: mrwastl Date: Mon, 10 May 2010 18:29:53 +0200 Subject: added missing out-of-bounds paranoia check --- common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.c b/common.c index f791d16..fff0013 100644 --- a/common.c +++ b/common.c @@ -45,7 +45,7 @@ GLCD::cType TimeType(time_t Time, const std::string &Format) { // for vdr < 1.5.x: force locale for correct language output. for >= 1.5.x: system locale should be fine #if APIVERSNUM < 10503 - setlocale(LC_TIME, locID[Setup.OSDLanguage]); + setlocale(LC_TIME, ( Setup.OSDLanguage < (int)(sizeof(locID)/sizeof(char*)) ) ? locID[Setup.OSDLanguage] : "en_US" ); #endif strftime(result, sizeof(result), Format.c_str(), tm); -- cgit v1.2.3