* Small optimization for set_timer(): now only removes the timer from the list
if it won't be added anymore. * Small fix for set_timer(): now set the timer->due field back to 0 when a timer is removed - this prevented a timer from being correctly readded later (possible crash)! * net_buffer's append_cloned_data() now does some more checks to prevent unnecessary work and detect wrong arguments. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19375 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -845,12 +845,15 @@ status_t
|
||||
append_cloned_data(net_buffer *_buffer, net_buffer *_source, uint32 offset,
|
||||
size_t bytes)
|
||||
{
|
||||
if (bytes == 0)
|
||||
return B_OK;
|
||||
|
||||
net_buffer_private *buffer = (net_buffer_private *)_buffer;
|
||||
net_buffer_private *source = (net_buffer_private *)_source;
|
||||
TRACE(("append_cloned_data(buffer %p, source %p, offset = %ld, bytes = %ld)\n",
|
||||
buffer, source, offset, bytes));
|
||||
|
||||
if (source->size < offset + bytes)
|
||||
if (source->size < offset + bytes || source->size < offset)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
// find data_node to start with from the source buffer
|
||||
|
||||
Reference in New Issue
Block a user