Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 573509 Details for
Bug 806051
[PEM] various flaws detected by Coverity
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Fix Coverity detected flaws
0002-Bug-806051-Fix-flaws-detected-by-Coverity.patch (text/plain), 3.43 KB, created by
Elio Maldonado Batiz
on 2012-03-29 03:21:19 UTC
(
hide
)
Description:
Fix Coverity detected flaws
Filename:
MIME Type:
Creator:
Elio Maldonado Batiz
Created:
2012-03-29 03:21:19 UTC
Size:
3.43 KB
patch
obsolete
>From e60c23ec53028ff569cea7cd71785f5c0c45fa78 Mon Sep 17 00:00:00 2001 >From: Elio Maldonado <emaldona@redhat.com> >Date: Wed, 28 Mar 2012 20:12:18 -0700 >Subject: [PATCH 2/3] Bugr 806051 Fix flaws detected by Coverity > >--- > mozilla/security/nss/lib/ckfw/pem/pinst.c | 6 ------ > mozilla/security/nss/lib/ckfw/pem/prsa.c | 5 +++++ > mozilla/security/nss/lib/ckfw/pem/psession.c | 5 +++++ > mozilla/security/nss/lib/ckfw/pem/util.c | 7 ++++++- > 4 files changed, 16 insertions(+), 7 deletions(-) > >diff --git a/mozilla/security/nss/lib/ckfw/pem/pinst.c b/mozilla/security/nss/lib/ckfw/pem/pinst.c >index 2f25d5a..cd325ca 100644 >--- a/mozilla/security/nss/lib/ckfw/pem/pinst.c >+++ b/mozilla/security/nss/lib/ckfw/pem/pinst.c >@@ -407,9 +407,6 @@ AddCertificate(char *certfile, char *keyfile, PRBool cacert, > error = CKR_GENERAL_ERROR; > goto loser; > } >- if (error != CKR_OK) >- goto loser; >- o = NULL; > > /* Add the CA trust object */ > o = AddObjectIfNeeded(CKO_NETSCAPE_TRUST, pemTrust, objs[i], NULL, >@@ -428,9 +425,6 @@ AddCertificate(char *certfile, char *keyfile, PRBool cacert, > goto loser; > } > >- if (error != CKR_OK) >- goto loser; >- > o = NULL; > > if (keyfile) { /* add the private key */ >diff --git a/mozilla/security/nss/lib/ckfw/pem/prsa.c b/mozilla/security/nss/lib/ckfw/pem/prsa.c >index 8d4fb92..f0e069c 100644 >--- a/mozilla/security/nss/lib/ckfw/pem/prsa.c >+++ b/mozilla/security/nss/lib/ckfw/pem/prsa.c >@@ -420,6 +420,11 @@ pem_mdCryptoOperationRSA_GetFinalLength > const NSSItem *modulus = > pem_FetchAttribute(iOperation->iKey, CKA_MODULUS); > >+ if (NULL == modulus) { >+ *pError = CKR_FUNCTION_FAILED; >+ return 0; >+ } >+ > return modulus->size; > } > >diff --git a/mozilla/security/nss/lib/ckfw/pem/psession.c b/mozilla/security/nss/lib/ckfw/pem/psession.c >index 1532fdf..7a69b3c 100644 >--- a/mozilla/security/nss/lib/ckfw/pem/psession.c >+++ b/mozilla/security/nss/lib/ckfw/pem/psession.c >@@ -255,6 +255,11 @@ pem_mdSession_Login > } > } > >+ if (NULL == io) { >+ rv = CKR_SLOT_ID_INVALID; >+ goto loser; >+ } >+ > /* Convert the IV from hex into an array of bytes */ > iv = convert_iv(io->u.key.ivstring, 8); > >diff --git a/mozilla/security/nss/lib/ckfw/pem/util.c b/mozilla/security/nss/lib/ckfw/pem/util.c >index fafb924..976772f 100644 >--- a/mozilla/security/nss/lib/ckfw/pem/util.c >+++ b/mozilla/security/nss/lib/ckfw/pem/util.c >@@ -164,7 +164,7 @@ ReadDERFromFile(SECItem *** derlist, char *filename, PRBool ascii, > } > > /* check for headers and trailers and remove them */ >- if ((body = strstr(asc, "-----BEGIN")) != NULL) { >+ if (strstr(asc, "-----BEGIN") != NULL) { > int key = 0; > while ((asc) && ((body = strstr(asc, "-----BEGIN")) != NULL)) { > key = 0; >@@ -226,6 +226,7 @@ ReadDERFromFile(SECItem *** derlist, char *filename, PRBool ascii, > asc = trailer + 1; > *trailer = '\0'; > } else { >+ free(der); > goto loser; > } > >@@ -246,8 +247,12 @@ ReadDERFromFile(SECItem *** derlist, char *filename, PRBool ascii, > der = nss_ZNEW(NULL, SECItem); > rv = ATOB_ConvertAsciiToItem(der, asc); > if (rv) { >+ nss_ZFreeIf(der); > goto loser; > } >+ >+ /* NOTE: This code path has never been tested. */ >+ PUT_Object(der, error); > } > > nss_ZFreeIf(filedata.data); >-- >1.7.7.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
kdudka
: review+
Actions:
View
|
Diff
Attachments on
bug 806051
: 573509