From 6f912d247fdb4f16c99e6e974f5a4d0b59dfd80f Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 1 Jun 2009 11:45:52 +0200 Subject: [PATCH] Fixed handling the length of DiSEqC command sequences --- CONTRIBUTORS | 1 + HISTORY | 1 + dvbdevice.c | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 4159b66f..99463b7b 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1219,6 +1219,7 @@ Reinhard Nissl for reporting a problem in case the PIDs change during recording for reporting a memory leak when reaching the end of a recording during replay for reporting a call to close(-1) in cUnbufferedFile::Close() + for reporting a possible problem in handling the length of DiSEqC command sequences Richard Robson for reporting freezing replay if a timer starts while in Transfer Mode from the diff --git a/HISTORY b/HISTORY index 278af297..bfc46413 100644 --- a/HISTORY +++ b/HISTORY @@ -6117,3 +6117,4 @@ Video Disk Recorder Revision History - Fixed calling close(-1) in cUnbufferedFile::Close() (reported by Reinhard Nissl). - Added a workaround for the broken linux-dvb driver header files (based on a patch from Tobias Grimm). +- Fixed handling the length of DiSEqC command sequences (reported by Reinhard Nissl). diff --git a/dvbdevice.c b/dvbdevice.c index f8e176fc..a57693e4 100644 --- a/dvbdevice.c +++ b/dvbdevice.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.c 2.18 2009/05/15 11:08:18 kls Exp $ + * $Id: dvbdevice.c 2.19 2009/06/01 11:42:06 kls Exp $ */ #include "dvbdevice.h" @@ -232,8 +232,8 @@ bool cDvbTuner::SetFrontend(void) uchar *codes = diseqc->Codes(n); if (codes) { struct dvb_diseqc_master_cmd cmd; - memcpy(cmd.msg, codes, min(n, int(sizeof(cmd.msg)))); - cmd.msg_len = n; + cmd.msg_len = min(n, int(sizeof(cmd.msg))); + memcpy(cmd.msg, codes, cmd.msg_len); CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd)); } }