On Sat, Nov 01, 2014 at 00:26, Joel Sing wrote:
> On Fri, 31 Oct 2014, Ted Unangst wrote:
>> Don't need BUF_ and its NULL arg handling here.
>
> Looks like you need to cvs up... beck@ nuked these and put BUF_strdup()
> under
> LIBRESSL_INTERNAL about two weeks ago. He missed the comment (second chunk)
> though.
Indeed, though I think these are ok without the null checks.
Index: store/str_lib.c
===================================================================
RCS file: /cvs/src/lib/libssl/src/crypto/store/str_lib.c,v
retrieving revision 1.11
diff -u -p -r1.11 str_lib.c
--- store/str_lib.c 16 Oct 2014 03:19:02 -0000 1.11
+++ store/str_lib.c 31 Oct 2014 15:44:48 -0000
@@ -1341,7 +1341,7 @@ STORE_ATTR_INFO_set_cstr(STORE_ATTR_INFO
return 0;
}
if (!ATTR_IS_SET(attrs, code)) {
- if (cstr && (attrs->values[code].cstring = strndup(cstr,
cstr_size)))
+ if ((attrs->values[code].cstring = strndup(cstr, cstr_size)))
return 1;
STOREerr(STORE_F_STORE_ATTR_INFO_SET_CSTR,
ERR_R_MALLOC_FAILURE);
Index: x509/x509_trs.c
===================================================================
RCS file: /cvs/src/lib/libssl/src/crypto/x509/x509_trs.c,v
retrieving revision 1.17
diff -u -p -r1.17 x509_trs.c
--- x509/x509_trs.c 16 Oct 2014 03:19:02 -0000 1.17
+++ x509/x509_trs.c 31 Oct 2014 15:45:55 -0000
@@ -203,7 +203,7 @@ X509_TRUST_add(int id, int flags, int (*
if (trtmp->flags & X509_TRUST_DYNAMIC_NAME)
free(trtmp->name);
/* dup supplied name */
- if (name == NULL || (trtmp->name = strdup(name)) == NULL)
+ if ((trtmp->name = strdup(name)) == NULL)
goto err;
/* Keep the dynamic flag of existing entry */
trtmp->flags &= X509_TRUST_DYNAMIC;
Index: x509v3/v3_addr.c
===================================================================
RCS file: /cvs/src/lib/libssl/src/crypto/x509v3/v3_addr.c,v
retrieving revision 1.13
diff -u -p -r1.13 v3_addr.c
--- x509v3/v3_addr.c 13 Jul 2014 16:03:10 -0000 1.13
+++ x509v3/v3_addr.c 31 Oct 2014 04:12:45 -0000
@@ -1019,7 +1019,7 @@ v2i_IPAddrBlocks(const struct v3_ext_met
length = length_from_afi(afi);
/*
- * Handle SAFI, if any, and BUF_strdup() so we can
null-terminate
+ * Handle SAFI, if any, and strdup() so we can null-terminate
* the other input values.
*/
if (safi != NULL) {