connman.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] build: Cleanup of iwd provision_service_wifi()
@ 2021-10-18  8:16 Emmanuel VAUTRIN
  2021-10-18  8:16 ` [PATCH 2/3] build: Fix uninitialized errors in iptables tests Emmanuel VAUTRIN
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Emmanuel VAUTRIN @ 2021-10-18  8:16 UTC (permalink / raw)
  To: connman; +Cc: Emmanuel VAUTRIN

gcc reports with:

 src/config.c: In function 'try_provision_service':
 src/config.c:1421:3: error: 'ssid' may be used uninitialized in this
function [-Werror=maybe-uninitialized]
  1421 |   provision_service_wifi(config, service, network,
       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1422 |        ssid, ssid_len);
       |        ~~~~~~~~~~~~~~~

Removing the useless ssid and ssid_len parameters solves the problem.
---
 src/config.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/config.c b/src/config.c
index 62023b1072da..33fdc7375c15 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1106,8 +1106,7 @@ static char *config_pem_fsid(const char *pem_file)
 
 static void provision_service_wifi(struct connman_config_service *config,
 				struct connman_service *service,
-				struct connman_network *network,
-				const void *ssid, unsigned int ssid_len)
+				struct connman_network *network)
 {
 	if (config->eap)
 		__connman_service_set_string(service, "EAP", config->eap);
@@ -1418,8 +1417,7 @@ static int try_provision_service(struct connman_config_service *config,
 						config->timeservers);
 
 	if (type == CONNMAN_SERVICE_TYPE_WIFI) {
-		provision_service_wifi(config, service, network,
-							ssid, ssid_len);
+		provision_service_wifi(config, service, network);
 	}
 
 	__connman_service_mark_dirty();
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] build: Fix uninitialized errors in iptables tests
  2021-10-18  8:16 [PATCH 1/3] build: Cleanup of iwd provision_service_wifi() Emmanuel VAUTRIN
@ 2021-10-18  8:16 ` Emmanuel VAUTRIN
  2021-10-18  8:16 ` [PATCH 3/3] build: Fix uninitialized false positive in dnsproxy Emmanuel VAUTRIN
  2021-10-20  6:08 ` [PATCH 1/3] build: Cleanup of iwd provision_service_wifi() Daniel Wagner
  2 siblings, 0 replies; 6+ messages in thread
From: Emmanuel VAUTRIN @ 2021-10-18  8:16 UTC (permalink / raw)
  To: connman; +Cc: Emmanuel VAUTRIN

gcc reports with:

 tools/iptables-test.c: In function 'main':
 tools/iptables-test.c:148:3: error: 'err' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   148 |   exit(err);
       |   ^~~~~~~~~
 tools/ip6tables-test.c: In function 'main':
 tools/ip6tables-test.c:149:3: error: 'err' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   149 |   exit(err);
       |   ^~~~~~~~~
---
 tools/ip6tables-test.c | 2 +-
 tools/iptables-test.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ip6tables-test.c b/tools/ip6tables-test.c
index 41e842dd64af..a52f4af04edf 100644
--- a/tools/ip6tables-test.c
+++ b/tools/ip6tables-test.c
@@ -45,7 +45,7 @@ int main(int argc, char *argv[])
 {
 	enum iptables_command cmd = IPTABLES_COMMAND_UNKNOWN;
 	char *table = NULL, *chain = NULL, *rule = NULL, *tmp;
-	int err, c, i;
+	int err = -EINVAL, c, i;
 
 	opterr = 0;
 
diff --git a/tools/iptables-test.c b/tools/iptables-test.c
index e9b7cb224d7a..f9d091eb9490 100644
--- a/tools/iptables-test.c
+++ b/tools/iptables-test.c
@@ -44,7 +44,7 @@ int main(int argc, char *argv[])
 {
 	enum iptables_command cmd = IPTABLES_COMMAND_UNKNOWN;
 	char *table = NULL, *chain = NULL, *rule = NULL, *tmp;
-	int err, c, i;
+	int err = -EINVAL, c, i;
 
 	opterr = 0;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] build: Fix uninitialized false positive in dnsproxy
  2021-10-18  8:16 [PATCH 1/3] build: Cleanup of iwd provision_service_wifi() Emmanuel VAUTRIN
  2021-10-18  8:16 ` [PATCH 2/3] build: Fix uninitialized errors in iptables tests Emmanuel VAUTRIN
@ 2021-10-18  8:16 ` Emmanuel VAUTRIN
  2021-10-20  6:08 ` [PATCH 1/3] build: Cleanup of iwd provision_service_wifi() Daniel Wagner
  2 siblings, 0 replies; 6+ messages in thread
From: Emmanuel VAUTRIN @ 2021-10-18  8:16 UTC (permalink / raw)
  To: connman; +Cc: Emmanuel VAUTRIN

gcc reports with:

 git/src/dnsproxy.c: In function 'update_domain':
 git/src/dnsproxy.c:2735:4: error: 'dom' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  2735 |    g_free(dom);
       |    ^~~~~~~~~~~
---
 src/dnsproxy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/dnsproxy.c b/src/dnsproxy.c
index 4b65b3790bb9..fbbee0413f8f 100644
--- a/src/dnsproxy.c
+++ b/src/dnsproxy.c
@@ -2707,7 +2707,7 @@ static void update_domain(int index, const char *domain, bool append)
 	for (list = server_list; list; list = list->next) {
 		struct server_data *data = list->data;
 		GList *dom_list;
-		char *dom;
+		char *dom = NULL;
 		bool dom_found = false;
 
 		if (data->index < 0)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] build: Cleanup of iwd provision_service_wifi()
  2021-10-18  8:16 [PATCH 1/3] build: Cleanup of iwd provision_service_wifi() Emmanuel VAUTRIN
  2021-10-18  8:16 ` [PATCH 2/3] build: Fix uninitialized errors in iptables tests Emmanuel VAUTRIN
  2021-10-18  8:16 ` [PATCH 3/3] build: Fix uninitialized false positive in dnsproxy Emmanuel VAUTRIN
@ 2021-10-20  6:08 ` Daniel Wagner
  2021-10-20  6:13   ` Daniel Wagner
  2 siblings, 1 reply; 6+ messages in thread
From: Daniel Wagner @ 2021-10-20  6:08 UTC (permalink / raw)
  To: connman, Emmanuel VAUTRIN; +Cc: Daniel Wagner, Emmanuel VAUTRIN

On Mon, 18 Oct 2021 10:16:00 +0200, Emmanuel VAUTRIN wrote:
> gcc reports with:
> 
>  src/config.c: In function 'try_provision_service':
>  src/config.c:1421:3: error: 'ssid' may be used uninitialized in this
> function [-Werror=maybe-uninitialized]
>   1421 |   provision_service_wifi(config, service, network,
>        |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   1422 |        ssid, ssid_len);
>        |        ~~~~~~~~~~~~~~~
> 
> [...]

Applied, thanks!

[1/3] build: Cleanup of iwd provision_service_wifi()
      commit: a75b0693ace6e226cfc15e0a1534f7e2cbf3f47c
[2/3] build: Fix uninitialized errors in iptables tests
      commit: dff52fff9b26065e433fedb73ed259d82f06ac73
[3/3] build: Fix uninitialized false positive in dnsproxy
      commit: fdbdaab520726afdb07cc042eb159392aa4fc9d6

Best regards,
-- 
Daniel Wagner <wagi@monom.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] build: Cleanup of iwd provision_service_wifi()
  2021-10-20  6:08 ` [PATCH 1/3] build: Cleanup of iwd provision_service_wifi() Daniel Wagner
@ 2021-10-20  6:13   ` Daniel Wagner
  2021-10-20 14:31     ` VAUTRIN Emmanuel (Canal Plus Prestataire)
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Wagner @ 2021-10-20  6:13 UTC (permalink / raw)
  To: connman, Emmanuel VAUTRIN; +Cc: Emmanuel VAUTRIN

Hi Emmanual

On Wed, Oct 20, 2021 at 08:08:16AM +0200, Daniel Wagner wrote:
> On Mon, 18 Oct 2021 10:16:00 +0200, Emmanuel VAUTRIN wrote:

Thanks for updating your setup. I could pick up these patches via b4 and
process them easily. Really appreciated you took the time to setup it!

> > gcc reports with:

Ahaaa, I thought -Werror=maybe-uninitialized was for clang. Stupid me...

> >  src/config.c: In function 'try_provision_service':
> >  src/config.c:1421:3: error: 'ssid' may be used uninitialized in this
> > function [-Werror=maybe-uninitialized]
> >   1421 |   provision_service_wifi(config, service, network,
> >        |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >   1422 |        ssid, ssid_len);
> >        |        ~~~~~~~~~~~~~~~
> > 
> > [...]
> 
> Applied, thanks!
> 
> [1/3] build: Cleanup of iwd provision_service_wifi()
>       commit: a75b0693ace6e226cfc15e0a1534f7e2cbf3f47c
> [2/3] build: Fix uninitialized errors in iptables tests
>       commit: dff52fff9b26065e433fedb73ed259d82f06ac73
> [3/3] build: Fix uninitialized false positive in dnsproxy
>       commit: fdbdaab520726afdb07cc042eb159392aa4fc9d6

BTW, I updated the prefix of the commit title, so the SHAs don't match.

Thanks,
Daniel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH 1/3] build: Cleanup of iwd provision_service_wifi()
  2021-10-20  6:13   ` Daniel Wagner
@ 2021-10-20 14:31     ` VAUTRIN Emmanuel (Canal Plus Prestataire)
  0 siblings, 0 replies; 6+ messages in thread
From: VAUTRIN Emmanuel (Canal Plus Prestataire) @ 2021-10-20 14:31 UTC (permalink / raw)
  To: connman

Hi Daniel,

> Thanks for updating your setup. I could pick up these patches via b4 and
> process them easily. Really appreciated you took the time to setup it!
Indeed, it will be much easier for both of us.

> Ahaaa, I thought -Werror=maybe-uninitialized was for clang. 
Yes, it was a misunderstanding, I have seen you already had fixed something
similar.

> 
> Applied, thanks!
> 
Great news, thank you!

Emmanuel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-20 14:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18  8:16 [PATCH 1/3] build: Cleanup of iwd provision_service_wifi() Emmanuel VAUTRIN
2021-10-18  8:16 ` [PATCH 2/3] build: Fix uninitialized errors in iptables tests Emmanuel VAUTRIN
2021-10-18  8:16 ` [PATCH 3/3] build: Fix uninitialized false positive in dnsproxy Emmanuel VAUTRIN
2021-10-20  6:08 ` [PATCH 1/3] build: Cleanup of iwd provision_service_wifi() Daniel Wagner
2021-10-20  6:13   ` Daniel Wagner
2021-10-20 14:31     ` VAUTRIN Emmanuel (Canal Plus Prestataire)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).