Re: [openssl-commits] [openssl] memset(0, ...) and NULL assignment

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [openssl-commits] [openssl] memset(0, ...) and NULL assignment

Benjamin Kaduk
On 09/03/2015 03:26 PM, Rich Salz wrote:

> The branch master has been updated
>        via  64b25758edca688a30f02c260262150f7ad0bc7d (commit)
>       from  fb4844bbc62fb014c115cd8fd2fc4304cba6eb89 (commit)
>
>
> - Log -----------------------------------------------------------------
> commit 64b25758edca688a30f02c260262150f7ad0bc7d
> Author: Rich Salz <[hidden email]>
> Date:   Thu Sep 3 09:15:26 2015 -0400
>
>     remove 0 assignments.
>    
>     After openssl_zalloc, cleanup more "set to 0/NULL" assignments.
>     Many are from github feedback.

Interestingly, Viktor had just added some explicit NULL assignments
after memset-to-zero a few days ago in
a0724ef1c9b9e2090bdd96b784f492b6a3952957.  It is permitted for the NULL
pointer to have a representation other than all-zeros, but such
platforms are rare, and are explicitly excluded from the supported
platforms list for, e.g., MIT krb5.  Does openssl want to try to support
such platforms?

-Ben
_______________________________________________
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
Reply | Threaded
Open this post in threaded view
|

Re: [openssl-commits] [openssl] memset(0, ...) and NULL assignment

Viktor Dukhovni
On Thu, Sep 03, 2015 at 03:34:38PM -0500, Benjamin Kaduk wrote:

> Interestingly, Viktor had just added some explicit NULL assignments
> after memset-to-zero a few days ago in
> a0724ef1c9b9e2090bdd96b784f492b6a3952957.  It is permitted for the NULL
> pointer to have a representation other than all-zeros, but such
> platforms are rare, and are explicitly excluded from the supported
> platforms list for, e.g., MIT krb5.  Does openssl want to try to support
> such platforms?

In Postfix, Wietse and I doggedly avoid relying on NULL being stored
as zero, whether or not any of our supported platforms violate
that.  Thus all pointers in malloced structures are initialized to
NULL explicitly.

So I tend to support the "general" case in other code I write.  I
would not have removed explicit NULL assignments, but if the project
explicitly disavows the exotic platorms, and we decide to optimize
out the redundant NULL assigments, I can live with that.

--
        Viktor.
_______________________________________________
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
Reply | Threaded
Open this post in threaded view
|

Re: [openssl-commits] [openssl] memset(0, ...) and NULL assignment

Salz, Rich
> So I tend to support the "general" case in other code I write.  I would not
> have removed explicit NULL assignments, but if the project explicitly
> disavows the exotic platorms, and we decide to optimize out the redundant
> NULL assigments, I can live with that.

I'm going to add a test for this.  So at least such bizarre wonderments will know they're failing :)
_______________________________________________
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev