OpenSSL CVS Repository
http://cvs.openssl.org/
____________________________________________________________
________________
Server: cvs.openssl.org Name: Ben
Laurie
Root: /v/openssl/cvs Email: ben openssl.org
Module: openssl Date:
05-Apr-2007 18:58:40
Branch: HEAD Handle:
2007040517583900
Modified files:
openssl/crypto/pem pem.h pem_err.c pem_info.c
Log:
Don't dereference NULL argument. Coverity ID 52.
Summary:
Revision Changes Path
1.60 +1 -0 openssl/crypto/pem/pem.h
1.16 +2 -1 openssl/crypto/pem/pem_err.c
1.30 +6 -0 openssl/crypto/pem/pem_info.c
____________________________________________________________
________________
patch -p0 <<' .'
Index: openssl/crypto/pem/pem.h
============================================================
================
$ cvs diff -u -r1.59 -r1.60 pem.h
--- openssl/crypto/pem/pem.h 19 Dec 2006 19:49:01
-0000 1.59
+++ openssl/crypto/pem/pem.h 5 Apr 2007 16:58:39
-0000 1.60
 -615,6 +615,7 
#define PEM_R_BAD_PASSWORD_READ 104
#define PEM_R_BAD_VERSION_NUMBER 117
#define PEM_R_BIO_WRITE_FAILURE 118
+#define PEM_R_CIPHER_IS_NULL 127
#define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115
#define PEM_R_EXPECTING_PRIVATE_KEY_BLOB 119
#define PEM_R_EXPECTING_PUBLIC_KEY_BLOB 120
 .
patch -p0 <<' .'
Index: openssl/crypto/pem/pem_err.c
============================================================
================
$ cvs diff -u -r1.15 -r1.16 pem_err.c
--- openssl/crypto/pem/pem_err.c 21 Nov 2006 21:29:40
-0000 1.15
+++ openssl/crypto/pem/pem_err.c 5 Apr 2007 16:58:39
-0000 1.16
 -1,6 +1,6 
/* crypto/pem/pem_err.c */
/*
============================================================
========
- * Copyright (c) 1999-2006 The OpenSSL Project. All
rights reserved.
+ * Copyright (c) 1999-2007 The OpenSSL Project. All
rights reserved.
*
* Redistribution and use in source and binary forms,
with or without
* modification, are permitted provided that the
following conditions
 -123,6 +123,7 
{ERR_REASON(PEM_R_BAD_PASSWORD_READ) ,"bad
password read"},
{ERR_REASON(PEM_R_BAD_VERSION_NUMBER) ,"bad
version number"},
{ERR_REASON(PEM_R_BIO_WRITE_FAILURE) ,"bio write
failure"},
+{ERR_REASON(PEM_R_CIPHER_IS_NULL) ,"cipher is
null"},
{ERR_REASON(PEM_R_ERROR_CONVERTING_PRIVATE_KEY),"error
converting private key"},
{ERR_REASON(PEM_R_EXPECTING_PRIVATE_KEY_BLOB),"expectin
g private key blob"},
{ERR_REASON(PEM_R_EXPECTING_PUBLIC_KEY_BLOB),"expecting
public key blob"},
 .
patch -p0 <<' .'
Index: openssl/crypto/pem/pem_info.c
============================================================
================
$ cvs diff -u -r1.29 -r1.30 pem_info.c
--- openssl/crypto/pem/pem_info.c 24 May 2006 13:29:30
-0000 1.29
+++ openssl/crypto/pem/pem_info.c 5 Apr 2007 16:58:39
-0000 1.30
 -339,6 +339,12 
{
if ( (xi->enc_data!=NULL) &&
(xi->enc_len>0) )
{
+ if (enc == NULL)
+ {
+ PEMerr(PEM_F_PEM_X509_INFO_WRITE_BIO,PEM_R_CIPHER_IS_NU
LL);
+ goto err;
+ }
+
/* copy from weirdo names into more normal things */
iv=xi->enc_cipher.iv;
data=(unsigned char *)xi->enc_data;
 .
____________________________________________________________
__________
OpenSSL Project http://www.openssl.org
CVS Repository Commit List
openssl-cvs openssl.org
Automated List Manager
majordomo openssl.org
|