diff options
author | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2018-01-08 07:58:33 +0100 |
---|---|---|
committer | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2018-01-08 07:58:33 +0100 |
commit | 7ad94d1427d304483e9bf1cf1d12065f8e41d712 (patch) | |
tree | 573016db50a53b71487101245ffcaf38aab5a92a /src/credential/gnunet-service-credential.c | |
parent | cc5bb40d158b207c384ae98c868573771735f10a (diff) | |
download | gnunet-7ad94d1427d304483e9bf1cf1d12065f8e41d712.tar.gz gnunet-7ad94d1427d304483e9bf1cf1d12065f8e41d712.zip |
bugfixes
Diffstat (limited to 'src/credential/gnunet-service-credential.c')
-rw-r--r-- | src/credential/gnunet-service-credential.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/credential/gnunet-service-credential.c b/src/credential/gnunet-service-credential.c index be88839e9..a2c339363 100644 --- a/src/credential/gnunet-service-credential.c +++ b/src/credential/gnunet-service-credential.c | |||
@@ -722,6 +722,12 @@ backward_resolution (void* cls, | |||
722 | strcpy (issuer_attribute_name, | 722 | strcpy (issuer_attribute_name, |
723 | ds_entry->unresolved_attribute_delegation); | 723 | ds_entry->unresolved_attribute_delegation); |
724 | char *next_attr = strtok (issuer_attribute_name, "."); | 724 | char *next_attr = strtok (issuer_attribute_name, "."); |
725 | if (NULL == next_attr) | ||
726 | { | ||
727 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
728 | "Failed to parse next attribute\n"); | ||
729 | continue; | ||
730 | } | ||
725 | GNUNET_asprintf (&lookup_attribute, | 731 | GNUNET_asprintf (&lookup_attribute, |
726 | "%s.gnu", | 732 | "%s.gnu", |
727 | next_attr); | 733 | next_attr); |
@@ -806,7 +812,7 @@ delegation_chain_resolution_start (void* cls) | |||
806 | * Check for attributes from the issuer and follow the chain | 812 | * Check for attributes from the issuer and follow the chain |
807 | * till you get the required subject's attributes | 813 | * till you get the required subject's attributes |
808 | */ | 814 | */ |
809 | char issuer_attribute_name[strlen (vrh->issuer_attribute)]; | 815 | char issuer_attribute_name[strlen (vrh->issuer_attribute) + strlen (".gnu") + 1]; |
810 | strcpy (issuer_attribute_name, | 816 | strcpy (issuer_attribute_name, |
811 | vrh->issuer_attribute); | 817 | vrh->issuer_attribute); |
812 | strcpy (issuer_attribute_name + strlen (vrh->issuer_attribute), | 818 | strcpy (issuer_attribute_name + strlen (vrh->issuer_attribute), |
@@ -889,7 +895,7 @@ handle_verify (void *cls, | |||
889 | vrh->issuer_key = v_msg->issuer_key; | 895 | vrh->issuer_key = v_msg->issuer_key; |
890 | vrh->subject_key = v_msg->subject_key; | 896 | vrh->subject_key = v_msg->subject_key; |
891 | vrh->issuer_attribute = GNUNET_strdup (issuer_attribute); | 897 | vrh->issuer_attribute = GNUNET_strdup (issuer_attribute); |
892 | if (NULL == issuer_attribute) | 898 | if (0 == strlen (issuer_attribute)) |
893 | { | 899 | { |
894 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 900 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
895 | "No issuer attribute provided!\n"); | 901 | "No issuer attribute provided!\n"); |
@@ -1033,7 +1039,7 @@ handle_collect (void *cls, | |||
1033 | &vrh->subject_key); | 1039 | &vrh->subject_key); |
1034 | vrh->issuer_attribute = GNUNET_strdup (issuer_attribute); | 1040 | vrh->issuer_attribute = GNUNET_strdup (issuer_attribute); |
1035 | 1041 | ||
1036 | if (NULL == issuer_attribute) | 1042 | if (0 == strlen (issuer_attribute)) |
1037 | { | 1043 | { |
1038 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1044 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
1039 | "No issuer attribute provided!\n"); | 1045 | "No issuer attribute provided!\n"); |
@@ -1076,7 +1082,7 @@ check_collect (void *cls, | |||
1076 | } | 1082 | } |
1077 | attr = (const char *) &c_msg[1]; | 1083 | attr = (const char *) &c_msg[1]; |
1078 | 1084 | ||
1079 | if ( ('\0' != attr[ntohs(c_msg->header.size) - sizeof (struct CollectMessage) - 1]) || | 1085 | if ( ('\0' != attr[msg_size - sizeof (struct CollectMessage) - 1]) || |
1080 | (strlen (attr) > GNUNET_CREDENTIAL_MAX_LENGTH) ) | 1086 | (strlen (attr) > GNUNET_CREDENTIAL_MAX_LENGTH) ) |
1081 | { | 1087 | { |
1082 | GNUNET_break (0); | 1088 | GNUNET_break (0); |