[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] Possible bug in tools/libxl/libxl.c -- Variable passed by reference not set in one possible case
What I am trying to say is that shouldn't the code block highlighted in yellow should come before the block marked in green. Then it would update the value of *target_memkb and *max_memkb in all possible situations. 4346 ÂÂÂÂtargetÂ=Âlibxl__xs_read(gc,Ât,Âtarget_path); 4347 ÂÂÂÂstaticmaxÂ=Âlibxl__xs_read(gc,Ât,Âmax_path); 4348 ÂÂÂÂfreememslackÂ=Âlibxl__xs_read(gc,Ât,Âfree_mem_slack_path); 4349 ÂÂÂÂifÂ(targetÂ&&ÂstaticmaxÂ&&Âfreememslack)Â{ 4350 ÂÂÂÂÂÂÂÂrcÂ=Â0; 4351 ÂÂÂÂÂÂÂÂgotoÂout; 4352 ÂÂÂÂ} 4354 ÂÂÂÂifÂ(target)Â{ 4355 ÂÂÂÂÂÂÂÂ*target_memkbÂ=Âstrtoul(target,Â&endptr,Â10); 4356 ÂÂÂÂÂÂÂÂifÂ(*endptrÂ!=Â'\0')Â{ 4357 ÂÂÂÂÂÂÂÂÂÂÂÂLIBXL__LOG_ERRNO(ctx,ÂLIBXL__LOG_ERROR, 4358 ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ"invalidÂmemoryÂtargetÂ%sÂfromÂ%s\n",Âtarget,Âtarget_path); 4359 ÂÂÂÂÂÂÂÂÂÂÂÂrcÂ=ÂERROR_FAIL; 4360 ÂÂÂÂÂÂÂÂÂÂÂÂgotoÂout; 4361 ÂÂÂÂÂÂÂÂ} 4362 ÂÂÂÂ} 4364 ÂÂÂÂifÂ(staticmax)Â{ 4365 ÂÂÂÂÂÂÂÂ*max_memkbÂ=Âstrtoul(staticmax,Â&endptr,Â10); 4366 ÂÂÂÂÂÂÂÂifÂ(*endptrÂ!=Â'\0')Â{ 4367 ÂÂÂÂÂÂÂÂÂÂÂÂLIBXL__LOG_ERRNO(ctx,ÂLIBXL__LOG_ERROR, 4368 ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ"invalidÂmemoryÂstatic-maxÂ%sÂfromÂ%s\n", 4369 ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂstaticmax,Âmax_path); 4370 ÂÂÂÂÂÂÂÂÂÂÂÂrcÂ=ÂERROR_FAIL; 4371 ÂÂÂÂÂÂÂÂÂÂÂÂgotoÂout; 4372 ÂÂÂÂÂÂÂÂ} 4373 ÂÂÂÂ} Regards,
Ayush Ruia. On Thu, Oct 9, 2014 at 8:07 PM, ayush ruia <ayushruia@xxxxxxxxx> wrote:
_______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |