mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-29 15:43:56 +00:00
Prevent crash if dumping buffer contents
This commit is contained in:
parent
572d7c2b5d
commit
abdd3e12c9
@ -504,9 +504,10 @@ int asprintable(int c)
|
||||
return c;
|
||||
}
|
||||
|
||||
int ob_dump(struct overlay_buffer *b,char *desc)
|
||||
int ob_dump(struct overlay_buffer *b, char *desc)
|
||||
{
|
||||
DEBUGF("overlay_buffer '%s' at %p : position=%d, size=%d", desc, b, b->position, b->sizeLimit);
|
||||
dump(NULL, b->bytes, b->sizeLimit>b->position?b->sizeLimit:b->position);
|
||||
DEBUGF("overlay_buffer '%s' at %p (%p) : position=%d, size=%d", desc, b, b->bytes, b->position, b->sizeLimit);
|
||||
if (b->bytes && (b->position || b->sizeLimit))
|
||||
dump(desc, b->bytes, b->position?b->position:b->sizeLimit);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user