summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Wilke <vdr@joachim-wilke.de>2010-10-31 13:43:13 +0100
committerJoachim Wilke <vdr@joachim-wilke.de>2010-10-31 13:43:13 +0100
commitc19273f938a73cb6507d10eef6e83955e76c9a00 (patch)
treecd693f9a6107472763afee0ca7d0ab0d77c92fb0
parentc3c2cbc91f8653c897c872562244511ecff7c857 (diff)
downloadvdr-plugin-lcdproc-c19273f938a73cb6507d10eef6e83955e76c9a00.tar.gz
vdr-plugin-lcdproc-c19273f938a73cb6507d10eef6e83955e76c9a00.tar.bz2
Fixed a possible buffer overflow in cLcd::SetRunning which caused an ABRT signal with recent libc
-rw-r--r--HISTORY2
-rw-r--r--lcd.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/HISTORY b/HISTORY
index 8db68cf..5aa17c3 100644
--- a/HISTORY
+++ b/HISTORY
@@ -94,6 +94,8 @@ Head:
- implemented cStatus::SetAudioChannel and SetAudioTrack to display audio track
information on lcd.
- adapted Makefile for VDR >= 1.7.13
+- fixed a possible buffer overflow in cLcd::SetRunning which caused an ABRT signal with
+ recent libc
\ No newline at end of file
diff --git a/lcd.c b/lcd.c
index af618bd..4229166 100644
--- a/lcd.c
+++ b/lcd.c
@@ -495,8 +495,8 @@ void cLcd::SetRunning( bool nownext, const char *string1, const char *string2, c
ThreadStateData.lcdfullbuffer[LCDTITLE][i++]=' ';
}
ThreadStateData.lcdfullbuffer[LCDTITLE][i]='\0';
- sprintf(now1,"%s",ThreadStateData.lcdbuffer[LCDTITLE][2]);
- sprintf(now2,"%s",ThreadStateData.lcdbuffer[LCDTITLE][3]);
+ snprintf(now1,LCDMAXWID,"%s",ThreadStateData.lcdbuffer[LCDTITLE][2]);
+ snprintf(now2,LCDMAXWID,"%s",ThreadStateData.lcdbuffer[LCDTITLE][3]);
EndMutualExclusion();
}