diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2013-12-29 17:20:22 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2013-12-29 17:20:22 +0100 |
commit | 63ee17701a51ae721a1d0b4517783d3ffba35f74 (patch) | |
tree | 53ade4de48377167029865937ba5d900f4d4625d /ci.c | |
parent | 00e2415b81aa1808ab084874cb2eedccb89ec5ca (diff) | |
download | vdr-63ee17701a51ae721a1d0b4517783d3ffba35f74.tar.gz vdr-63ee17701a51ae721a1d0b4517783d3ffba35f74.tar.bz2 |
Added a check to avoid a possible NULL pointer dereference in cCiSession::SendData()
Diffstat (limited to 'ci.c')
-rw-r--r-- | ci.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: ci.c 3.1 2013/12/28 11:57:51 kls Exp $ + * $Id: ci.c 3.2 2013/12/29 15:51:08 kls Exp $ */ #include "ci.h" @@ -403,7 +403,8 @@ void cCiSession::SendData(int Tag, int Length, const uint8_t *Data) *p++ = Tag & 0xFF; p = SetLength(p, Length); if (p - buffer + Length < int(sizeof(buffer))) { - memcpy(p, Data, Length); + if (Data) + memcpy(p, Data, Length); p += Length; tc->SendData(p - buffer, buffer); } |