From ddf48642f1325c4673e2903a7e40e8815b4ec8b2 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Sun, 3 Apr 2011 17:57:09 +1000 Subject: [PATCH] Don't crash if there are zero valued attributes --- util_saml.cpp | 2 +- util_shib.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/util_saml.cpp b/util_saml.cpp index fd84e44..26bf544 100644 --- a/util_saml.cpp +++ b/util_saml.cpp @@ -662,7 +662,7 @@ gss_eap_saml_attr_provider::getAttribute(const gss_buffer_t attr, if (i == -1) i = 0; - else if (i >= nvalues) + if (i >= nvalues) return false; #ifdef __APPLE__ av = (const saml2::AttributeValue *)((void *)(a->getAttributeValues().at(i))); diff --git a/util_shib.cpp b/util_shib.cpp index 07ee06c..778ad25 100644 --- a/util_shib.cpp +++ b/util_shib.cpp @@ -331,7 +331,7 @@ gss_eap_shib_attr_provider::getAttribute(const gss_buffer_t attr, if (i == -1) i = 0; - else if (i >= nvalues) + if (i >= nvalues) return false; buf.value = (void *)shibAttr->getSerializedValues()[*more].c_str(); -- 2.1.4