[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 19/28: properly detect and handle parse error
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 19/28: properly detect and handle parse error |
Date: |
Fri, 10 Mar 2017 18:19:03 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
commit ffff350361b66d318d8890328c7efc3757252f82
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Mar 10 17:57:40 2017 +0100
properly detect and handle parse error
---
src/gns/plugin_gnsrecord_gns.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/gns/plugin_gnsrecord_gns.c b/src/gns/plugin_gnsrecord_gns.c
index 5faca4578..5d611e19e 100644
--- a/src/gns/plugin_gnsrecord_gns.c
+++ b/src/gns/plugin_gnsrecord_gns.c
@@ -279,9 +279,10 @@ gns_string_to_value (void *cls,
}
*data_size = sizeof (struct GNUNET_TUN_GnsVpnRecord) + strlen (s_serv)
+ 1;
*data = vpn = GNUNET_malloc (*data_size);
- if (GNUNET_OK != GNUNET_CRYPTO_eddsa_public_key_from_string ((char*)
s_peer,
- strlen
(s_peer),
-
&vpn->peer.public_key))
+ if (GNUNET_OK !=
+ GNUNET_CRYPTO_eddsa_public_key_from_string ((char*) s_peer,
+ strlen (s_peer),
+ &vpn->peer.public_key))
{
GNUNET_free (vpn);
*data_size = 0;
@@ -362,9 +363,14 @@ gns_string_to_value (void *cls,
}
*data_size = sizeof (struct GNUNET_GNSRECORD_ReverseRecord) + strlen
(known_by) + 1;
*data = rev = GNUNET_malloc (*data_size);
- GNUNET_CRYPTO_ecdsa_public_key_from_string (pkey_str,
- strlen (pkey_str),
- &rev->pkey);
+ if (GNUNET_OK !=
+ GNUNET_CRYPTO_ecdsa_public_key_from_string (pkey_str,
+ strlen (pkey_str),
+ &rev->pkey))
+ {
+ GNUNET_free (rev);
+ return GNUNET_SYSERR;
+ }
rev->expiration = expiration;
GNUNET_memcpy (&rev[1],
known_by,
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] 15/28: add assertion to make static analysis happy, (continued)
- [GNUnet-SVN] [gnunet] 15/28: add assertion to make static analysis happy, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 16/28: disambiguate enum type of value, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 09/28: fix memory leak, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 17/28: add assertion to make static analysis happy, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 12/28: fix ICMP IPv4/IPv6 type conversion logic, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 22/28: check return value from dup2, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 14/28: fix double-free, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 11/28: fix double-free, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 18/28: fix integer overflow test to actually work, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 21/28: remove redundant condition in assertion, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 19/28: properly detect and handle parse error,
gnunet <=
- [GNUnet-SVN] [gnunet] 13/28: prevent division by zero, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 23/28: check return value from GNUNET_program_run, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 24/28: fix comment, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 27/28: add assertion to make static analysis happy, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 25/28: use correct channel when switching, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 26/28: add assertion to make static analysis happy, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 28/28: add assertion to make static analysis happy, gnunet, 2017/03/10