Re: [PATCH 7/8] logging: always NUL-terminate circular buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/27/2011 02:51 AM, Laine Stump wrote:
> On 03/26/2011 08:12 AM, Eric Blake wrote:
>> * src/util/logging.c (virLogStartup, virLogSetBufferSize):
>> Over-allocate, so that a debugger can just print the circular
>> buffer.  Suggested by Daniel Veillard.
>> ---
>>
>> Original post:
>> https://www.redhat.com/archives/libvir-list/2011-March/msg01107.html
>>
>>   src/util/logging.c |    8 ++++----
>>   1 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/util/logging.c b/src/util/logging.c
>> index f4910ad..48c0cfd 100644
>> --- a/src/util/logging.c
>> +++ b/src/util/logging.c
>> @@ -197,14 +197,14 @@ int virLogStartup(void) {
>>
>>       virLogInitialized = 1;
>>       virLogLock();
>> -    if (VIR_ALLOC_N(virLogBuffer, virLogSize)<  0) {
>> +    if (VIR_ALLOC_N(virLogBuffer, virLogSize + 1)<  0) {
>>           /*
> 
> ACK

Thanks; pushed.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]