* "next" & "previous" could be NULL, but were still referenced - based on
Oliver's patch for bug #4896 which this one fixes. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33908 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -338,11 +338,19 @@ FragmentPacket::AddFragment(uint16 start, uint16 end, net_buffer* buffer,
|
|||||||
status_t status = gBufferModule->merge(buffer, next, true);
|
status_t status = gBufferModule->merge(buffer, next, true);
|
||||||
TRACE(" merge next: %s", strerror(status));
|
TRACE(" merge next: %s", strerror(status));
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
fFragments.Insert((net_buffer*)previous->link.next, next);
|
// Insert "next" at its previous position
|
||||||
|
if (previous != NULL)
|
||||||
|
fFragments.Insert((net_buffer*)previous->link.next, next);
|
||||||
|
else
|
||||||
|
fFragments.Insert(next);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
fFragments.Insert((net_buffer*)previous->link.next, buffer);
|
if (previous != NULL)
|
||||||
|
fFragments.Insert((net_buffer*)previous->link.next, buffer);
|
||||||
|
else
|
||||||
|
fFragments.Insert(buffer);
|
||||||
|
|
||||||
// cut down existing hole
|
// cut down existing hole
|
||||||
fBytesLeft -= end - start;
|
fBytesLeft -= end - start;
|
||||||
|
|||||||
Reference in New Issue
Block a user