diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-05-05 15:47:25 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-05-05 15:47:25 +0200 |
commit | dddbd46874b28adea871bce37d6ba603c86dc7c3 (patch) | |
tree | 5292b3887a96988294f760d845ec450e4cf81b4b | |
parent | cd0ba460fac715c59c8985f85e3718333164a316 (diff) | |
download | gnutls-dddbd46874b28adea871bce37d6ba603c86dc7c3.tar.gz |
small fixes identified by coverity.
-rw-r--r-- | lib/gnutls_priority.c | 6 | ||||
-rw-r--r-- | lib/gnutls_x509.c | 2 | ||||
-rw-r--r-- | lib/nettle/egd.c | 3 | ||||
-rw-r--r-- | lib/verify-tofu.c | 2 |
4 files changed, 9 insertions, 4 deletions
diff --git a/lib/gnutls_priority.c b/lib/gnutls_priority.c index 1fb440edd8..3093527ea6 100644 --- a/lib/gnutls_priority.c +++ b/lib/gnutls_priority.c @@ -205,13 +205,15 @@ gnutls_compression_set_priority (gnutls_session_t session, const int *list) int gnutls_protocol_set_priority (gnutls_session_t session, const int *list) { - _set_priority (&session->internals.priorities.protocol, list); /* set the current version to the first in the chain. * This will be overridden later. */ if (list) - _gnutls_set_current_version (session, list[0]); + { + _set_priority (&session->internals.priorities.protocol, list); + _gnutls_set_current_version (session, list[0]); + } return 0; } diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c index d67ad5bf23..25a9c1c24a 100644 --- a/lib/gnutls_x509.c +++ b/lib/gnutls_x509.c @@ -1723,7 +1723,7 @@ gnutls_certificate_set_x509_trust (gnutls_certificate_credentials_t res, return ret; cleanup: - for (j=0;j<i;i++) + for (j=0;j<i;j++) gnutls_x509_crt_deinit(new_list[j]); return ret; diff --git a/lib/nettle/egd.c b/lib/nettle/egd.c index dc0bd2373e..e8ee8042c4 100644 --- a/lib/nettle/egd.c +++ b/lib/nettle/egd.c @@ -211,6 +211,9 @@ restart: if (*fd == -1 || do_restart) *fd = _rndegd_connect_socket (); + if (*fd == -1) + return -1; + do_restart = 0; nbytes = length < 255 ? length : 255; diff --git a/lib/verify-tofu.c b/lib/verify-tofu.c index e0f69e7184..d021ec524d 100644 --- a/lib/verify-tofu.c +++ b/lib/verify-tofu.c @@ -360,7 +360,7 @@ static int raw_pubkey_to_base64(const gnutls_datum_t* raw, gnutls_datum_t * b64) char* out; ret = base64_encode_alloc((void*)raw->data, raw->size, &out); - if (ret == 0) + if (ret == 0 || out == NULL) return gnutls_assert_val(GNUTLS_E_MEMORY_ERROR); b64->data = (void*)out; |