diff options
author | Robin Nehls <nehls@mi.fu-berlin.de> | 2010-01-05 15:42:46 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-05 17:17:43 +0100 |
commit | 7ec3a35354e8f06f8cddc4adaf1be32266f94a80 (patch) | |
tree | e182874d5018eed1891256fe02433ae9b07bbd93 /src | |
parent | 669e59425fb48314771375516823b3714e7d0d5a (diff) | |
download | usdx-7ec3a35354e8f06f8cddc4adaf1be32266f94a80.tar.gz usdx-7ec3a35354e8f06f8cddc4adaf1be32266f94a80.tar.xz usdx-7ec3a35354e8f06f8cddc4adaf1be32266f94a80.zip |
Added check to ringbuffer if a given targetbuffer is NULL
Diffstat (limited to 'src')
-rw-r--r-- | src/base/ringbuffer.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/base/ringbuffer.cpp b/src/base/ringbuffer.cpp index 7adcd332..d324f74f 100644 --- a/src/base/ringbuffer.cpp +++ b/src/base/ringbuffer.cpp @@ -51,6 +51,10 @@ namespace usdx if (count <= 0) return count; + // check if the buffer is NULL + if (buffer == NULL) + return -1; + // adjust output count if (count > buffer_count) { @@ -81,6 +85,10 @@ namespace usdx if (count <= 0) return count; + // check if the buffer is NULL + if (buffer == NULL) + return -1; + // skip input data if the input buffer is bigger than the ring-buffer if (count > buffer_size) { |