[edk2-devel] [PATCH v3 0/1] Add PCD to disable safe string constraint assertions

Sean via Groups.Io sean.brogan=microsoft.com at groups.io
Mon Jan 6 22:54:29 UTC 2020


On Mon, Jan 6, 2020 at 10:43 AM, Vitaly Cheptsov wrote:

> 
> My original suggestion was to remove the assertions entirely, but several
> people here said that they use them to verify usage errors when handling
> trusted data. This makes good sense to me, so we suggest to support both
> cases by introducing a PCD in this patch.

I strongly agree with Vitaly.
These asserts cause more trouble than help.  The asserts cause the caller to implement the same checks as the functions and thus make the functional checks useless overhead and complicate the calling code.  These functions are in a base library used in hundreds of unique places and thus should not make assumptions about how to handle errors.  Since they have the ability to and must return error codes (since asserts are generally off in production) this code should rely on the caller to handle the error appropriately.

thanks
Sean

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#52944): https://edk2.groups.io/g/devel/message/52944
Mute This Topic: https://groups.io/mt/69401948/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20200106/611f610a/attachment.htm>


More information about the edk2-devel-archive mailing list