check for zero product vendor ID and non-zero product ID

This commit is contained in:
Andreas Steffen 2012-10-09 20:07:51 +02:00
parent 7207793d57
commit 190d6fc37a
1 changed files with 8 additions and 0 deletions

View File

@ -144,6 +144,14 @@ METHOD(pa_tnc_attr_t, process, status_t,
reader->read_data (reader, reader->remaining(reader), &product_name);
reader->destroy(reader);
if (!this->product_vendor_id && this->product_id)
{
DBG1(DBG_TNC, "IETF product information vendor ID is 0 "
"but product ID is not 0");
*offset = 3;
return FAILED;
}
this->product_name = malloc(product_name.len + 1);
memcpy(this->product_name, product_name.ptr, product_name.len);
this->product_name[product_name.len] = '\0';