LinuxTV Patchwork cSkinXXXXDisplayMenu::SetEvent(): fix date buffer size

login
register
mail settings
Submitter glenvt18
Date May 26, 2016, 3:59 p.m.
Message ID <1464278377-28705-1-git-send-email-glenvt18@gmail.com>
Download mbox | patch
Permalink /patch/34433/
State New
Headers show

Comments

glenvt18 - May 26, 2016, 3:59 p.m.
32 bytes is not enough for multi-byte utf8 strings

Date string is truncated.

Please review,
Sergey Chernyavskiy.
---
 PLUGINS/src/skincurses/skincurses.c | 2 +-
 skinclassic.c                       | 2 +-
 skinlcars.c                         | 2 +-
 skinsttng.c                         | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

Patch

diff --git a/PLUGINS/src/skincurses/skincurses.c b/PLUGINS/src/skincurses/skincurses.c
index 358035e..fcf183d 100644
--- a/PLUGINS/src/skincurses/skincurses.c
+++ b/PLUGINS/src/skincurses/skincurses.c
@@ -407,7 +407,7 @@  void cSkinCursesDisplayMenu::SetEvent(const cEvent *Event)
      return;
   int y = 2;
   cTextScroller ts;
-  char t[32];
+  char t[64];
   snprintf(t, sizeof(t), "%s  %s - %s", *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString());
   ts.Set(osd, 0, y, ScOsdWidth, ScOsdHeight - y - 2, t, &Font, clrYellow, clrBackground);
   if (Event->Vps() && Event->Vps() != Event->StartTime()) {
diff --git a/skinclassic.c b/skinclassic.c
index b6d183b..410230d 100644
--- a/skinclassic.c
+++ b/skinclassic.c
@@ -352,7 +352,7 @@  void cSkinClassicDisplayMenu::SetEvent(const cEvent *Event)
   const cFont *font = cFont::GetFont(fontOsd);
   int y = y2;
   cTextScroller ts;
-  char t[32];
+  char t[64];
   snprintf(t, sizeof(t), "%s  %s - %s", *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString());
   ts.Set(osd, x1, y, x2 - x1, y3 - y, t, font, Theme.Color(clrMenuEventTime), Theme.Color(clrBackground));
   if (Event->Vps() && Event->Vps() != Event->StartTime()) {
diff --git a/skinlcars.c b/skinlcars.c
index d84a753..7c5561c 100644
--- a/skinlcars.c
+++ b/skinlcars.c
@@ -1636,7 +1636,7 @@  void cSkinLCARSDisplayMenu::SetEvent(const cEvent *Event)
   int xl = xi00;
   int y = yi00;
   cTextScroller ts;
-  char t[32];
+  char t[64];
   snprintf(t, sizeof(t), "%s  %s - %s", *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString());
   ts.Set(osd, xl, y, xi01 - xl, yi01 - y, t, font, Theme.Color(clrEventTime), Theme.Color(clrBackground));
   if (Event->Vps() && Event->Vps() != Event->StartTime()) {
diff --git a/skinsttng.c b/skinsttng.c
index f10f120..f81b13e 100644
--- a/skinsttng.c
+++ b/skinsttng.c
@@ -655,7 +655,7 @@  void cSkinSTTNGDisplayMenu::SetEvent(const cEvent *Event)
   int xl = x3 + TextSpacing;
   int y = y3;
   cTextScroller ts;
-  char t[32];
+  char t[64];
   snprintf(t, sizeof(t), "%s  %s - %s", *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString());
   ts.Set(osd, xl, y, x4 - xl, y4 - y, t, font, Theme.Color(clrMenuEventTime), Theme.Color(clrBackground));
   if (Event->Vps() && Event->Vps() != Event->StartTime()) {

Privacy Policy