Correct buffer->size at the same time as buffer->capacity when shrinking down a
A message that is not in the archive (sent off-list or not yet received): [email protected]
Thanks Ewan, Dan and I were banging our heads on this one.
Good Catch!
Regards,
Anthony Liguori
Quoted 36 lines · Xen patchbot -unstable
# HG changeset patch
# User [email protected]
# Node ID418954da5c0f58bc856893f3850b0d97deb143ec
# Parent3f39f030fa894d29d04b748513bf48000d6a17f5
Correctbuffer->sizeat the same time asbuffer->capacitywhen shrinking down a buffer that has grown beyondmax_capacity. This fixes a Xenconsoled segfault that was caused by stomping around above the buffer's allocated region. It became possible to set themax_capacitywith changeset 7431, and ever since then we have been exposed to this bug. It would most easily be triggered by running a domain without a client attached to the console, so that themax_capacitywas reached more easily.Closes bug #380.
Signed-off-by Ewan Mellor <[email protected]>diff -r
3f39f030fa89-r418954da5c0ftools/console/daemon/io.ctools/console/daemon/io.c +1
-1@@ -114,7 +114,7 @@ buffer->data, buffer->max_capacity); buffer->data =realloc (buffer->data, buffer->max_capacity); - buffer->capacity = buffer->max_capacity; + buffer->size = buffer->capacity = buffer->max_capacity; } }_______________________________________________
Xen-changelog mailing list
[email protected]
http://lists.xensource.com/xen-changelog