summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/srp/srp_vfy.c
diff options
context:
space:
mode:
authorbeck <>2014-07-22 02:21:20 +0000
committerbeck <>2014-07-22 02:21:20 +0000
commitc4e3191290f7dc034878e8c9eee2f395db280afd (patch)
tree98cdda658409d8b250bb1c60e392a61894be842a /src/lib/libcrypto/srp/srp_vfy.c
parent2384810741e4764a84e9c140c697eb7f1ff264c0 (diff)
downloadopenbsd-c4e3191290f7dc034878e8c9eee2f395db280afd.tar.gz
openbsd-c4e3191290f7dc034878e8c9eee2f395db280afd.tar.bz2
openbsd-c4e3191290f7dc034878e8c9eee2f395db280afd.zip
Kill a bunch more BUF_strdup's - these are converted to have a check for
NULL before an intrinsic strdup. ok miod@
Diffstat (limited to 'src/lib/libcrypto/srp/srp_vfy.c')
-rw-r--r--src/lib/libcrypto/srp/srp_vfy.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/libcrypto/srp/srp_vfy.c b/src/lib/libcrypto/srp/srp_vfy.c
index 6de843527d..0b2a3415c2 100644
--- a/src/lib/libcrypto/srp/srp_vfy.c
+++ b/src/lib/libcrypto/srp/srp_vfy.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: srp_vfy.c,v 1.8 2014/07/13 16:03:10 beck Exp $ */ 1/* $OpenBSD: srp_vfy.c,v 1.9 2014/07/22 02:21:20 beck Exp $ */
2/* Written by Christophe Renou (christophe.renou@edelweb.fr) with 2/* Written by Christophe Renou (christophe.renou@edelweb.fr) with
3 * the precious help of Peter Sylvester (peter.sylvester@edelweb.fr) 3 * the precious help of Peter Sylvester (peter.sylvester@edelweb.fr)
4 * for the EdelKey project and contributed to the OpenSSL project 2004. 4 * for the EdelKey project and contributed to the OpenSSL project 2004.
@@ -291,7 +291,7 @@ static SRP_gN_cache *SRP_gN_new_init(const char *ch)
291 if (newgN == NULL) 291 if (newgN == NULL)
292 return NULL; 292 return NULL;
293 293
294 if ((newgN->b64_bn = BUF_strdup(ch)) == NULL) 294 if (ch == NULL || (newgN->b64_bn = strdup(ch)) == NULL)
295 goto err; 295 goto err;
296 296
297 len = t_fromb64(tmp, ch); 297 len = t_fromb64(tmp, ch);
@@ -402,7 +402,8 @@ int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file)
402 if ((gN = malloc(sizeof(SRP_gN))) == NULL) 402 if ((gN = malloc(sizeof(SRP_gN))) == NULL)
403 goto err; 403 goto err;
404 404
405 if (!(gN->id = BUF_strdup(pp[DB_srpid])) 405 if ( (pp[DB_srpid] == NULL)
406 || !(gN->id = strdup(pp[DB_srpid]))
406 || !(gN->N = SRP_gN_place_bn(vb->gN_cache,pp[DB_srpverifier])) 407 || !(gN->N = SRP_gN_place_bn(vb->gN_cache,pp[DB_srpverifier]))
407 || !(gN->g = SRP_gN_place_bn(vb->gN_cache,pp[DB_srpsalt])) 408 || !(gN->g = SRP_gN_place_bn(vb->gN_cache,pp[DB_srpsalt]))
408 || sk_SRP_gN_insert(SRP_gN_tab,gN,0) == 0) 409 || sk_SRP_gN_insert(SRP_gN_tab,gN,0) == 0)