summaryrefslogtreecommitdiff
path: root/src/credential/plugin_gnsrecord_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/plugin_gnsrecord_credential.c
parentcc5bb40d158b207c384ae98c868573771735f10a (diff)
bugfixes
Diffstat (limited to 'src/credential/plugin_gnsrecord_credential.c')
-rw-r--r--src/credential/plugin_gnsrecord_credential.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/credential/plugin_gnsrecord_credential.c b/src/credential/plugin_gnsrecord_credential.c
index 342790b7a..ffb2857dc 100644
--- a/src/credential/plugin_gnsrecord_credential.c
+++ b/src/credential/plugin_gnsrecord_credential.c
@@ -199,6 +199,13 @@ credential_string_to_value (void *cls,
GNUNET_free (tmp_str);
tmp_str = GNUNET_strdup (s);
token = strtok (tmp_str, ",");
+ if (NULL == token)
+ {
+ GNUNET_free (tmp_str);
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Malformed string %s\n", s);
+ return GNUNET_SYSERR;
+ }
struct GNUNET_CREDENTIAL_DelegationSet set[entries];
for (i=0;i<entries;i++)
{
@@ -219,7 +226,10 @@ credential_string_to_value (void *cls,
set);
if (-1 == tmp_data_size)
+ {
+ GNUNET_free (tmp_str);
return GNUNET_SYSERR;
+ }
*data_size += tmp_data_size;
*data = sets = GNUNET_malloc (*data_size);
GNUNET_CREDENTIAL_delegation_set_serialize (entries,