From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=ma58FwmW; spf=pass (domain: linaro.org, ip: 209.85.166.67, mailfrom: ard.biesheuvel@linaro.org) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by groups.io with SMTP; Tue, 11 Jun 2019 03:12:33 -0700 Received: by mail-io1-f67.google.com with SMTP id i10so9366802iol.13 for ; Tue, 11 Jun 2019 03:12:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wuu4X0uUl4RG+a8MhOGmAFqgspYPbVbiMD7VFE68IfM=; b=ma58FwmWddVkW+FG/l4zRYgwAa4gipsonSkNAzla6SxZEjQQtC7+AiJAekzY3OOCcf UqkLgdX8U31c/VPqS0Y+vifFh3BGRLupBSlMi3oAqmwU0kVO9SRCc+TLEGkaEcVWJQuD CbhcmknU0Hn5uOJA1qvBi36OvMSuqMX2m0Dsi2gGNEmPkEGCiNYA2pNZyPJBecLypHEV tTfxcnQg/tnrAy90W+7K8NhaCY3ZAGQkVIwYVhSXuiZolIG5nIr7suq48bhNi3rh+1rX Z/moVHCweNtfAR3q0KIgai0BLg2DDtwqlxbtK+pR8BRVsFhzebLpoo90EjKQ23kR/ssd PmAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wuu4X0uUl4RG+a8MhOGmAFqgspYPbVbiMD7VFE68IfM=; b=fG7YfadlOBh5ik16gSFiMb0dF5cY5g4v4uofkL1tZsFAjelhFjG+GnAsDLXoqC5up3 HnulHe1djoVO7/Bj6M6Ys9eP800EXQ8LfqPcwnLhTXVhgS7MvBO1f6UMszVRRaNZ53gX mgzCImS4cya7j6ZiYxXCA0MoJFmafXxdiJOmqLlG6sc76ICfpCJa/QKLurrxVYGYdTwe 4zZsL1EmX0+p5eFNxbY2ENnwxVOcmhbYaxfxji9cb2rv7kFf7RDjXClMRjgpGx0kP+Bq LLeB9JMEhaiTCea++vraq4VKMczieW48+991YCibnVgMZK19Jnc+vUFmaHx92flHbBom Gb6g== X-Gm-Message-State: APjAAAXr9ALBqSR6KkZ50XJzDO51/xf9K4fX7cHO0sqirQXxdc1WrJgH LlSmiZ97IUzC18EFoh0RkvWFXAFA0rEjB8poRORi6A== X-Google-Smtp-Source: APXvYqxd5MZtmYnK4o3ZAnoaIU6S1lZlA5gryFMnO7/kb0tdOT2Q9BATE6fhpTrF0TkhQbu/qMLTTkwkEsRWX37KDWg= X-Received: by 2002:a5d:8794:: with SMTP id f20mr298307ion.128.1560247952723; Tue, 11 Jun 2019 03:12:32 -0700 (PDT) MIME-Version: 1.0 References: <20190610142006.30007-1-ard.biesheuvel@linaro.org> <20190610142006.30007-6-ard.biesheuvel@linaro.org> <20190610180614.dbyijxbxdxwf3f7t@bivouac.eciton.net> <20190610190131.7kylqyi2s5tck2ii@bivouac.eciton.net> In-Reply-To: <20190610190131.7kylqyi2s5tck2ii@bivouac.eciton.net> From: "Ard Biesheuvel" Date: Tue, 11 Jun 2019 12:12:20 +0200 Message-ID: Subject: Re: [PATCH edk2-platforms 5/5] Platform/RDKQemu: stop using deprecated string conversion routines To: Leif Lindholm Cc: edk2-devel-groups-io Content-Type: text/plain; charset="UTF-8" On Mon, 10 Jun 2019 at 21:01, Leif Lindholm wrote: > > On Mon, Jun 10, 2019 at 08:55:03PM +0200, Ard Biesheuvel wrote: > > On Mon, 10 Jun 2019 at 20:06, Leif Lindholm wrote: > > > > > > On Mon, Jun 10, 2019 at 04:20:06PM +0200, Ard Biesheuvel wrote: > > > > Stop using deprecated string conversion routines so we can stop > > > > un'#define'ing the DISABLE_NEW_DEPRECATED_INTERFACES macro in this code. > > > > > > > > Signed-off-by: Ard Biesheuvel > > > > --- > > > > Platform/Comcast/Library/RdkBootManagerLib/DiskIo.c | 12 +++++++-- > > > > Platform/Comcast/Library/RdkBootManagerLib/RdkFile.c | 28 +++++++++++--------- > > > > Platform/Comcast/RDKQemu/RDKQemu.dsc | 3 --- > > > > 3 files changed, 26 insertions(+), 17 deletions(-) > > > > > > > > diff --git a/Platform/Comcast/Library/RdkBootManagerLib/DiskIo.c b/Platform/Comcast/Library/RdkBootManagerLib/DiskIo.c > > > > index ed893bd5af6a..df16c326cc57 100644 > > > > --- a/Platform/Comcast/Library/RdkBootManagerLib/DiskIo.c > > > > +++ b/Platform/Comcast/Library/RdkBootManagerLib/DiskIo.c > > > > @@ -90,6 +90,7 @@ ListBlockIos ( > > > > UINTN NumHandles; > > > > UINT16 *DeviceFullPath; > > > > DISKIO_PARTITION_LIST *Entry; > > > > + RETURN_STATUS RetStatus; > > > > > > > > InitializeListHead (&mPartitionListHead); > > > > > > > > @@ -146,11 +147,13 @@ ListBlockIos ( > > > > > > > > // Copy handle and partition name > > > > Entry->PartitionHandle = AllHandles[LoopIndex]; > > > > - StrnCpy ( > > > > + RetStatus = StrnCpyS ( > > > > Entry->PartitionName, > > > > + PARTITION_NAME_MAX_LENGTH, > > > > PartitionName, > > > > PARTITION_NAME_MAX_LENGTH > > > > ); > > > > + ASSERT_RETURN_ERROR (RetStatus); > > > > > > Would we not want to return an error here, for non-DEBUG builds? > > > > > > > Actually, I think I should just change the last arg to > > PARTITION_NAME_MAX_LENGTH - 1, in which case no input length based > > error is ever returned. > > Thats works for me. > With that, and the below style fixes: > Reviewed-by: Leif Lindholm > Thanks Series pushed as cf5d0a48c1d9..9f814bbee5d5