[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 04/28: handle case 'diff' is NULL - fixes NPE
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 04/28: handle case 'diff' is NULL - fixes NPE |
Date: |
Fri, 10 Mar 2017 18:18:48 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
commit 30d691f576a7c1327cfd88269aa025747aee6083
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Mar 10 17:25:16 2017 +0100
handle case 'diff' is NULL - fixes NPE
---
src/nat-auto/gnunet-nat-auto.c | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/src/nat-auto/gnunet-nat-auto.c b/src/nat-auto/gnunet-nat-auto.c
index 9ba81eb5f..5eb0a4be3 100644
--- a/src/nat-auto/gnunet-nat-auto.c
+++ b/src/nat-auto/gnunet-nat-auto.c
@@ -174,6 +174,9 @@ auto_config_cb (void *cls,
GNUNET_NAT_AUTO_status2string (result),
nat_type);
+ if (NULL == diff)
+ return;
+
/* Shortcut: if there are no changes suggested, bail out early. */
if (GNUNET_NO ==
GNUNET_CONFIGURATION_is_dirty (diff))
@@ -186,20 +189,16 @@ auto_config_cb (void *cls,
to the user */
new_cfg = write_cfg ? GNUNET_CONFIGURATION_dup (cfg) : NULL;
- if (NULL != diff)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
- _("Suggested configuration changes:\n"));
- GNUNET_CONFIGURATION_iterate_section_values (diff,
- "nat",
- &auto_conf_iter,
- new_cfg);
- }
+ GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
+ _("Suggested configuration changes:\n"));
+ GNUNET_CONFIGURATION_iterate_section_values (diff,
+ "nat",
+ &auto_conf_iter,
+ new_cfg);
/* If desired, write configuration to file; we write only the
changes to the defaults to keep things compact. */
- if ( (write_cfg) &&
- (NULL != diff) )
+ if (write_cfg)
{
struct GNUNET_CONFIGURATION_Handle *def_cfg;
@@ -298,8 +297,8 @@ run (void *cls,
if (do_auto)
{
ah = GNUNET_NAT_AUTO_autoconfig_start (c,
- &auto_config_cb,
- NULL);
+ &auto_config_cb,
+ NULL);
}
if (use_tcp && use_udp)
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] branch master updated (1fee963ef -> 9fc7ff92a), gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 01/28: fix use of uninitialized (shadow-issue) expiration, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 08/28: fix memory leak, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 03/28: make sure 'err' is initialized on all error paths, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 06/28: properly handle error on empty queue, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 04/28: handle case 'diff' is NULL - fixes NPE,
gnunet <=
- [GNUnet-SVN] [gnunet] 02/28: make compiler happy, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 05/28: fix comment, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 07/28: fix memory leak, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 10/28: fix memory leak, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 20/28: fix out-of-bounds case in parser, gnunet, 2017/03/10
- [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