mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-17 06:04:23 +03:00
lvmetad: check result of buffer_realloc
This commit is contained in:
parent
c4dcbf67a3
commit
5c792f620b
@ -289,8 +289,9 @@ int buffer_append(struct buffer *buf, const char *string)
|
|||||||
{
|
{
|
||||||
int len = strlen(string);
|
int len = strlen(string);
|
||||||
|
|
||||||
if (buf->allocated - buf->used <= len)
|
if ((buf->allocated - buf->used <= len) &&
|
||||||
buffer_realloc(buf, len + 1);
|
!buffer_realloc(buf, len + 1))
|
||||||
|
return 0;
|
||||||
|
|
||||||
strcpy(buf->mem + buf->used, string);
|
strcpy(buf->mem + buf->used, string);
|
||||||
buf->used += len;
|
buf->used += len;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user