NULL before an intrinsic strdup.
ok miod@
-/* $OpenBSD: conf_mod.c,v 1.24 2014/07/13 16:03:09 beck Exp $ */
+/* $OpenBSD: conf_mod.c,v 1.25 2014/07/22 02:21:20 beck Exp $ */
/* Written by Stephen Henson (steve@openssl.org) for the OpenSSL
* project 2001.
*/
{
CONF_MODULE *tmod = NULL;
+ if (name == NULL)
+ return NULL;
if (supported_modules == NULL)
supported_modules = sk_CONF_MODULE_new_null();
if (supported_modules == NULL)
return NULL;
tmod->dso = dso;
- tmod->name = BUF_strdup(name);
+ tmod->name = strdup(name);
tmod->init = ifunc;
tmod->finish = ffunc;
tmod->links = 0;
-/* $OpenBSD: cryptlib.c,v 1.32 2014/07/11 08:44:47 jsing Exp $ */
+/* $OpenBSD: cryptlib.c,v 1.33 2014/07/22 02:21:20 beck Exp $ */
/* ====================================================================
* Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
*
CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_LOCKID, ERR_R_MALLOC_FAILURE);
return (0);
}
- if ((str = BUF_strdup(name)) == NULL) {
+ if (name == NULL || (str = strdup(name)) == NULL) {
CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_LOCKID, ERR_R_MALLOC_FAILURE);
return (0);
}
-/* $OpenBSD: srp_vfy.c,v 1.8 2014/07/13 16:03:10 beck Exp $ */
+/* $OpenBSD: srp_vfy.c,v 1.9 2014/07/22 02:21:20 beck Exp $ */
/* Written by Christophe Renou (christophe.renou@edelweb.fr) with
* the precious help of Peter Sylvester (peter.sylvester@edelweb.fr)
* for the EdelKey project and contributed to the OpenSSL project 2004.
if (newgN == NULL)
return NULL;
- if ((newgN->b64_bn = BUF_strdup(ch)) == NULL)
+ if (ch == NULL || (newgN->b64_bn = strdup(ch)) == NULL)
goto err;
len = t_fromb64(tmp, ch);
if ((gN = malloc(sizeof(SRP_gN))) == NULL)
goto err;
- if (!(gN->id = BUF_strdup(pp[DB_srpid]))
+ if ( (pp[DB_srpid] == NULL)
+ || !(gN->id = strdup(pp[DB_srpid]))
|| !(gN->N = SRP_gN_place_bn(vb->gN_cache,pp[DB_srpverifier]))
|| !(gN->g = SRP_gN_place_bn(vb->gN_cache,pp[DB_srpsalt]))
|| sk_SRP_gN_insert(SRP_gN_tab,gN,0) == 0)
-/* $OpenBSD: str_meth.c,v 1.6 2014/06/12 15:49:30 deraadt Exp $ */
+/* $OpenBSD: str_meth.c,v 1.7 2014/07/22 02:21:20 beck Exp $ */
/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
* project 2003.
*/
{
STORE_METHOD *store_method = calloc(1, sizeof(STORE_METHOD));
- if (store_method)
- store_method->name = BUF_strdup(name);
+ if (store_method && name)
+ store_method->name = strdup(name);
return store_method;
}
-/* $OpenBSD: ui_lib.c,v 1.27 2014/07/13 16:03:10 beck Exp $ */
+/* $OpenBSD: ui_lib.c,v 1.28 2014/07/22 02:21:20 beck Exp $ */
/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
* project 2001.
*/
{
UI_METHOD *ui_method = calloc(1, sizeof(UI_METHOD));
- if (ui_method)
- ui_method->name = BUF_strdup(name);
+ if (ui_method && name)
+ ui_method->name = strdup(name);
return ui_method;
}
-/* $OpenBSD: x509_vpm.c,v 1.9 2014/07/11 08:44:49 jsing Exp $ */
+/* $OpenBSD: x509_vpm.c,v 1.10 2014/07/22 02:21:20 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2004.
*/
X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name)
{
free(param->name);
- param->name = BUF_strdup(name);
+ if (name == NULL)
+ return 1;
+ param->name = strdup(name);
if (param->name)
return 1;
return 0;
-/* $OpenBSD: conf_mod.c,v 1.24 2014/07/13 16:03:09 beck Exp $ */
+/* $OpenBSD: conf_mod.c,v 1.25 2014/07/22 02:21:20 beck Exp $ */
/* Written by Stephen Henson (steve@openssl.org) for the OpenSSL
* project 2001.
*/
{
CONF_MODULE *tmod = NULL;
+ if (name == NULL)
+ return NULL;
if (supported_modules == NULL)
supported_modules = sk_CONF_MODULE_new_null();
if (supported_modules == NULL)
return NULL;
tmod->dso = dso;
- tmod->name = BUF_strdup(name);
+ tmod->name = strdup(name);
tmod->init = ifunc;
tmod->finish = ffunc;
tmod->links = 0;
-/* $OpenBSD: cryptlib.c,v 1.32 2014/07/11 08:44:47 jsing Exp $ */
+/* $OpenBSD: cryptlib.c,v 1.33 2014/07/22 02:21:20 beck Exp $ */
/* ====================================================================
* Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
*
CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_LOCKID, ERR_R_MALLOC_FAILURE);
return (0);
}
- if ((str = BUF_strdup(name)) == NULL) {
+ if (name == NULL || (str = strdup(name)) == NULL) {
CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_LOCKID, ERR_R_MALLOC_FAILURE);
return (0);
}
-/* $OpenBSD: srp_vfy.c,v 1.8 2014/07/13 16:03:10 beck Exp $ */
+/* $OpenBSD: srp_vfy.c,v 1.9 2014/07/22 02:21:20 beck Exp $ */
/* Written by Christophe Renou (christophe.renou@edelweb.fr) with
* the precious help of Peter Sylvester (peter.sylvester@edelweb.fr)
* for the EdelKey project and contributed to the OpenSSL project 2004.
if (newgN == NULL)
return NULL;
- if ((newgN->b64_bn = BUF_strdup(ch)) == NULL)
+ if (ch == NULL || (newgN->b64_bn = strdup(ch)) == NULL)
goto err;
len = t_fromb64(tmp, ch);
if ((gN = malloc(sizeof(SRP_gN))) == NULL)
goto err;
- if (!(gN->id = BUF_strdup(pp[DB_srpid]))
+ if ( (pp[DB_srpid] == NULL)
+ || !(gN->id = strdup(pp[DB_srpid]))
|| !(gN->N = SRP_gN_place_bn(vb->gN_cache,pp[DB_srpverifier]))
|| !(gN->g = SRP_gN_place_bn(vb->gN_cache,pp[DB_srpsalt]))
|| sk_SRP_gN_insert(SRP_gN_tab,gN,0) == 0)
-/* $OpenBSD: str_meth.c,v 1.6 2014/06/12 15:49:30 deraadt Exp $ */
+/* $OpenBSD: str_meth.c,v 1.7 2014/07/22 02:21:20 beck Exp $ */
/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
* project 2003.
*/
{
STORE_METHOD *store_method = calloc(1, sizeof(STORE_METHOD));
- if (store_method)
- store_method->name = BUF_strdup(name);
+ if (store_method && name)
+ store_method->name = strdup(name);
return store_method;
}
-/* $OpenBSD: ui_lib.c,v 1.27 2014/07/13 16:03:10 beck Exp $ */
+/* $OpenBSD: ui_lib.c,v 1.28 2014/07/22 02:21:20 beck Exp $ */
/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
* project 2001.
*/
{
UI_METHOD *ui_method = calloc(1, sizeof(UI_METHOD));
- if (ui_method)
- ui_method->name = BUF_strdup(name);
+ if (ui_method && name)
+ ui_method->name = strdup(name);
return ui_method;
}
-/* $OpenBSD: x509_vpm.c,v 1.9 2014/07/11 08:44:49 jsing Exp $ */
+/* $OpenBSD: x509_vpm.c,v 1.10 2014/07/22 02:21:20 beck Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2004.
*/
X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name)
{
free(param->name);
- param->name = BUF_strdup(name);
+ if (name == NULL)
+ return 1;
+ param->name = strdup(name);
if (param->name)
return 1;
return 0;