Completed implementation of PWG HCD attributes
[strongswan.git] / src / libimcv / generic / generic_attr_string.c
index e14e8d2..e63c012 100644 (file)
@@ -98,8 +98,14 @@ METHOD(pa_tnc_attr_t, process, status_t,
        {
                return NEED_MORE;
        }
-    pa_attr_names = imcv_pa_tnc_attributes->get_names(imcv_pa_tnc_attributes,
+       pa_attr_names = imcv_pa_tnc_attributes->get_names(imcv_pa_tnc_attributes,
                                                                                                          this->type.vendor_id);
+       if (this->value.len > this->length)
+       {
+               DBG1(DBG_TNC, "inconsistent length of %N/%N string attribute",
+                        pen_names, this->type.vendor_id, pa_attr_names, this->type.type);
+               return FAILED;
+       }
 
        pos = memchr(this->value.ptr, '\0', this->value.len);
        if (pos)