Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 May 2022 17:59:07 +0200
From:      "Alfonso S. Siciliano" <asiciliano@FreeBSD.org>
To:        Shawn Webb <shawn.webb@hardenedbsd.org>
Cc:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   Re: git: 9b4c606b96ce - main - bsdinstall/partedit: Fix UFS auto partitioning
Message-ID:  <c2664cae-1ee5-51be-b3e0-9edb9cfda4ca@FreeBSD.org>
In-Reply-To: <20220430002011.4zpqn3l4c3wsc3vm@mutt-hbsd>
References:  <202204292324.23TNOusA058900@gitrepo.freebsd.org> <20220430002011.4zpqn3l4c3wsc3vm@mutt-hbsd>

next in thread | previous in thread | raw e-mail | index | archive | help
On 4/30/22 02:20, Shawn Webb wrote:
> On Fri, Apr 29, 2022 at 11:24:56PM +0000, Alfonso S. Siciliano wrote:
>> The branch main has been updated by asiciliano:
>>
>> URL: https://cgit.FreeBSD.org/src/commit/?id=9b4c606b96ce8a8b011dc50295c71c38741a0f4f
>>
>> commit 9b4c606b96ce8a8b011dc50295c71c38741a0f4f
>> Author:     Alfonso S. Siciliano <asiciliano@FreeBSD.org>
>> AuthorDate: 2022-04-29 23:19:30 +0000
>> Commit:     Alfonso S. Siciliano <asiciliano@FreeBSD.org>
>> CommitDate: 2022-04-29 23:24:23 +0000
>>
>>      bsdinstall/partedit: Fix UFS auto partitioning
>>      
>>      Fix bsdinstall "Auto (UFS) Guided Disk Setup" and sade(8) "Auto".
>>      The problem is a string comparison failure, it arose during the
>>      dialog(3)/bsddialog(3) form conversion:
>>      
>>       * dialog uses only form.text while bsdialog differentiates between
>>         form.init and form.value.
>>       * dialog always allocates memory for form values while bsddialog only
>>         when a button is pressed.
>>      
>>      Reviewed by:            bapt
>>      Differential Revision:  https://reviews.freebsd.org/D35033
>> ---
>>   usr.sbin/bsdinstall/partedit/gpart_ops.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/usr.sbin/bsdinstall/partedit/gpart_ops.c b/usr.sbin/bsdinstall/partedit/gpart_ops.c
>> index 65cda247e146..26aedb58ef39 100644
>> --- a/usr.sbin/bsdinstall/partedit/gpart_ops.c
>> +++ b/usr.sbin/bsdinstall/partedit/gpart_ops.c
>> @@ -1154,6 +1154,12 @@ addpartform:
>>   			init_allocated = true;
>>   			goto addpartform;
>>   		}
>> +	} else { /* auto partitioning */
>> +		items[0].value = strdup(items[0].init);
>> +		items[1].value = strdup(items[1].init);
>> +		items[2].value = strdup(items[2].init);
>> +		if (nitems > 3)
>> +			items[3].value = strdup(items[3].init);
>>   	}
>>   
>>   	/*
>>
> 
> Hey Alfonso,
> 
> Would it be a good idea to check the return value of strdup in this
> particular case?

Hi Shawn,

Thanks for the report, maybe it could be a bit superfluous in this
context. However, I have not a strong opinion so I opened a review
<https://reviews.freebsd.org/D35106>.

Best regards,
Alfonso



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c2664cae-1ee5-51be-b3e0-9edb9cfda4ca>