summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-08-06 12:29:38 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-08-06 12:29:38 +0200
commit16c3b8f0e7f3bd4ba5148e188806eae7ddcfaf08 (patch)
tree3dd6536b8fab9f8cdc826ab56a836731c3684108 /channels.c
parentff5df8f29852a1c968a2797e13e494ae882bed26 (diff)
downloadvdr-16c3b8f0e7f3bd4ba5148e188806eae7ddcfaf08.tar.gz
vdr-16c3b8f0e7f3bd4ba5148e188806eae7ddcfaf08.tar.bz2
Fixed an out-of-bounds memory access with audio language ids
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/channels.c b/channels.c
index 04f6dc98..85778526 100644
--- a/channels.c
+++ b/channels.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: channels.c 1.43 2005/08/06 12:06:37 kls Exp $
+ * $Id: channels.c 1.44 2005/08/06 12:22:41 kls Exp $
*/
#include "channels.h"
@@ -446,14 +446,16 @@ void cChannel::SetPids(int Vpid, int Ppid, int *Apids, char ALangs[][4], int *Dp
dsyslog("changing pids of channel %d from %d+%d:%s:%d to %d+%d:%s:%d", Number(), vpid, ppid, OldApidsBuf, tpid, Vpid, Ppid, NewApidsBuf, Tpid);
vpid = Vpid;
ppid = Ppid;
- for (int i = 0; i <= MAXAPIDS; i++) { // <= to copy the terminating 0
+ for (int i = 0; i < MAXAPIDS; i++) {
apids[i] = Apids[i];
strn0cpy(alangs[i], ALangs[i], 4);
}
- for (int i = 0; i <= MAXDPIDS; i++) { // <= to copy the terminating 0
+ apids[MAXAPIDS] = 0;
+ for (int i = 0; i < MAXDPIDS; i++) {
dpids[i] = Dpids[i];
strn0cpy(dlangs[i], DLangs[i], 4);
}
+ dpids[MAXDPIDS] = 0;
tpid = Tpid;
modification |= mod;
Channels.SetModified();