=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/openssl/x509.c,v retrieving revision 1.7 retrieving revision 1.8 diff -c -r1.7 -r1.8 *** src/usr.bin/openssl/x509.c 2015/09/21 13:13:06 1.7 --- src/usr.bin/openssl/x509.c 2015/09/21 13:32:55 1.8 *************** *** 1,4 **** ! /* $OpenBSD: x509.c,v 1.7 2015/09/21 13:13:06 bcook Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * --- 1,4 ---- ! /* $OpenBSD: x509.c,v 1.8 2015/09/21 13:32:55 bcook Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * *************** *** 721,726 **** --- 721,730 ---- z = i2d_X509(x, NULL); m = malloc(z); + if (m == NULL) { + BIO_printf(bio_err, "out of mem\n"); + goto end; + } d = (unsigned char *) m; z = i2d_X509_NAME(X509_get_subject_name(x), &d);