diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2015-01-12 12:14:16 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2015-01-12 12:14:16 +0100 |
commit | 67fff7f4fcb83b5e1439bd7b8b3952ae3f423bc3 (patch) | |
tree | ee7d9eb651aab5183a5c384ec47f411f23c7deaa /tools.h | |
parent | 6e35f47a3ea064b78f038c69065a3b0781a8d5d4 (diff) | |
download | vdr-67fff7f4fcb83b5e1439bd7b8b3952ae3f423bc3.tar.gz vdr-67fff7f4fcb83b5e1439bd7b8b3952ae3f423bc3.tar.bz2 |
Fixed a possible out-of-bounds access in cVector::Remove()
Diffstat (limited to 'tools.h')
-rw-r--r-- | tools.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.h 3.4 2015/01/12 12:03:59 kls Exp $ + * $Id: tools.h 3.5 2015/01/12 12:13:33 kls Exp $ */ #ifndef __TOOLS_H @@ -575,6 +575,8 @@ public: } virtual void Remove(int Index) { + if (Index < 0) + return; // prevents out-of-bounds access if (Index < size - 1) memmove(&data[Index], &data[Index + 1], (size - Index) * sizeof(T)); size--; |