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/plugin_gnsrecord_credential.c | |
parent | cc5bb40d158b207c384ae98c868573771735f10a (diff) |
bugfixes
Diffstat (limited to 'src/credential/plugin_gnsrecord_credential.c')
-rw-r--r-- | src/credential/plugin_gnsrecord_credential.c | 10 |
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, |