aboutsummaryrefslogtreecommitdiff
path: root/src/credential/gnunet-service-credential.c
diff options
context:
space:
mode:
authorSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2018-01-08 07:58:33 +0100
committerSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2018-01-08 07:58:33 +0100
commit7ad94d1427d304483e9bf1cf1d12065f8e41d712 (patch)
tree573016db50a53b71487101245ffcaf38aab5a92a /src/credential/gnunet-service-credential.c
parentcc5bb40d158b207c384ae98c868573771735f10a (diff)
bugfixes
Diffstat (limited to 'src/credential/gnunet-service-credential.c')
-rw-r--r--src/credential/gnunet-service-credential.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/credential/gnunet-service-credential.c b/src/credential/gnunet-service-credential.c
index be88839e97..a2c3393630 100644
--- a/src/credential/gnunet-service-credential.c
+++ b/src/credential/gnunet-service-credential.c
@@ -722,6 +722,12 @@ backward_resolution (void* cls,
strcpy (issuer_attribute_name,
ds_entry->unresolved_attribute_delegation);
char *next_attr = strtok (issuer_attribute_name, ".");
+ if (NULL == next_attr)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to parse next attribute\n");
+ continue;
+ }
GNUNET_asprintf (&lookup_attribute,
"%s.gnu",
next_attr);
@@ -806,7 +812,7 @@ delegation_chain_resolution_start (void* cls)
* Check for attributes from the issuer and follow the chain
* till you get the required subject's attributes
*/
- char issuer_attribute_name[strlen (vrh->issuer_attribute)];
+ char issuer_attribute_name[strlen (vrh->issuer_attribute) + strlen (".gnu") + 1];
strcpy (issuer_attribute_name,
vrh->issuer_attribute);
strcpy (issuer_attribute_name + strlen (vrh->issuer_attribute),
@@ -889,7 +895,7 @@ handle_verify (void *cls,
vrh->issuer_key = v_msg->issuer_key;
vrh->subject_key = v_msg->subject_key;
vrh->issuer_attribute = GNUNET_strdup (issuer_attribute);
- if (NULL == issuer_attribute)
+ if (0 == strlen (issuer_attribute))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"No issuer attribute provided!\n");
@@ -1033,7 +1039,7 @@ handle_collect (void *cls,
&vrh->subject_key);
vrh->issuer_attribute = GNUNET_strdup (issuer_attribute);
- if (NULL == issuer_attribute)
+ if (0 == strlen (issuer_attribute))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"No issuer attribute provided!\n");
@@ -1076,7 +1082,7 @@ check_collect (void *cls,
}
attr = (const char *) &c_msg[1];
- if ( ('\0' != attr[ntohs(c_msg->header.size) - sizeof (struct CollectMessage) - 1]) ||
+ if ( ('\0' != attr[msg_size - sizeof (struct CollectMessage) - 1]) ||
(strlen (attr) > GNUNET_CREDENTIAL_MAX_LENGTH) )
{
GNUNET_break (0);