From dde78a340efe36913c4e6a785530b74912ba3815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 31 May 2005 01:17:25 +0000 Subject: [PATCH] Fixed off by one error: could call memcpy() with '0' as size argument. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12910 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/util/ring_buffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/kernel/util/ring_buffer.cpp b/src/system/kernel/util/ring_buffer.cpp index 5d5ae9349e..1b223b7e48 100644 --- a/src/system/kernel/util/ring_buffer.cpp +++ b/src/system/kernel/util/ring_buffer.cpp @@ -93,7 +93,7 @@ write_to_buffer(struct ring_buffer *buffer, const uint8 *data, ssize_t length, ssize_t bytesWritten = length; int32 position = buffer->first + buffer->in; - if (position + length < buffer->size) { + if (position + length <= buffer->size) { // simple copy if (user) { if (user_memcpy(buffer->buffer + position, data, length) < B_OK)