[lxc-devel] [PATCH] Ensure argv passed by createl to create is NULL terminated

Stéphane Graber stgraber at ubuntu.com
Mon Nov 26 18:14:59 UTC 2012


On 11/26/2012 01:10 PM, Serge Hallyn wrote:
> Quoting Dwight Engen (dwight.engen at oracle.com):
>> Signed-off-by: Dwight Engen <dwight.engen at oracle.com>
> 
> Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

Thanks, applied to staging.

>> ---
>>  src/lxc/lxccontainer.c |    3 ++-
>>  1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
>> index 37f5ed7..4818b2c 100644
>> --- a/src/lxc/lxccontainer.c
>> +++ b/src/lxc/lxccontainer.c
>> @@ -683,13 +683,14 @@ static bool lxcapi_createl(struct lxc_container *c, char *t, ...)
>>  		if (!arg)
>>  			break;
>>  		nargs++;
>> -		temp = realloc(args, nargs * sizeof(*args));
>> +		temp = realloc(args, (nargs+1) * sizeof(*args));
>>  		if (!temp)
>>  			goto out;
>>  		args = temp;
>>  		args[nargs - 1] = arg;
>>  	}
>>  	va_end(ap);
>> +	args[nargs] = NULL;
>>  
>>  	bret = c->create(c, t, args);
>>  
>> -- 
>> 1.7.1
>>
>>
>> ------------------------------------------------------------------------------
>> Monitor your physical, virtual and cloud infrastructure from a single
>> web console. Get in-depth insight into apps, servers, databases, vmware,
>> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
>> Pricing starts from $795 for 25 servers or applications!
>> http://p.sf.net/sfu/zoho_dev2dev_nov
>> _______________________________________________
>> Lxc-devel mailing list
>> Lxc-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/lxc-devel
> 
> ------------------------------------------------------------------------------
> Monitor your physical, virtual and cloud infrastructure from a single
> web console. Get in-depth insight into apps, servers, databases, vmware,
> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
> Pricing starts from $795 for 25 servers or applications!
> http://p.sf.net/sfu/zoho_dev2dev_nov
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel
> 


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 899 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20121126/f0298908/attachment.pgp>


More information about the lxc-devel mailing list