* [Buildroot] [PATCH 1/1] package/shadowsocks-libev: fix maybe-uninitialized errors
@ 2022-04-11 16:21 Fabrice Fontaine
2022-04-21 17:54 ` Arnout Vandecappelle
2022-05-23 10:57 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2022-04-11 16:21 UTC (permalink / raw)
To: buildroot; +Cc: Min Xu, Fabrice Fontaine
Fix the following build failure:
local.c: In function 'create_and_bind':
local.c:218:12: error: 'listen_sock' may be used uninitialized in this function [-Werror=maybe-uninitialized]
218 | return listen_sock;
| ^~~~~~~~~~~
Fixes:
- http://autobuild.buildroot.org/results/27471a878ff52a972ac087d534e44fb0c50808f6
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
.../0002-fix-maybe-uninitialized-errors.patch | 93 +++++++++++++++++++
1 file changed, 93 insertions(+)
create mode 100644 package/shadowsocks-libev/0002-fix-maybe-uninitialized-errors.patch
diff --git a/package/shadowsocks-libev/0002-fix-maybe-uninitialized-errors.patch b/package/shadowsocks-libev/0002-fix-maybe-uninitialized-errors.patch
new file mode 100644
index 0000000000..5275323e65
--- /dev/null
+++ b/package/shadowsocks-libev/0002-fix-maybe-uninitialized-errors.patch
@@ -0,0 +1,93 @@
+From 0c23224e926463b1097414979367655a27fa6d60 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Thu, 7 Apr 2022 18:27:58 +0200
+Subject: [PATCH] fix maybe-uninitialized errors
+
+Set {listen,server}_sock to -1 when needed as already done in
+src/manager.c by commit ecf1fcc84594b09ed2d61e3677cd8e62bd897ccb to
+avoid the following build failure:
+
+local.c: In function 'create_and_bind':
+local.c:218:12: error: 'listen_sock' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+ 218 | return listen_sock;
+ | ^~~~~~~~~~~
+
+Fixes:
+ - http://autobuild.buildroot.org/results/27471a878ff52a972ac087d534e44fb0c50808f6
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Retrieved from:
+https://github.com/shadowsocks/shadowsocks-libev/commit/0c23224e926463b1097414979367655a27fa6d60]
+---
+ src/local.c | 2 +-
+ src/redir.c | 2 +-
+ src/server.c | 2 +-
+ src/tunnel.c | 2 +-
+ src/udprelay.c | 2 +-
+ 5 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/local.c b/src/local.c
+index b1ab040bb..47d634ce5 100644
+--- a/src/local.c
++++ b/src/local.c
+@@ -168,7 +168,7 @@ create_and_bind(const char *addr, const char *port)
+ {
+ struct addrinfo hints;
+ struct addrinfo *result, *rp;
+- int s, listen_sock;
++ int s, listen_sock = -1;
+
+ memset(&hints, 0, sizeof(struct addrinfo));
+ hints.ai_family = AF_UNSPEC; /* Return IPv4 and IPv6 choices */
+diff --git a/src/redir.c b/src/redir.c
+index 4a5a489f0..e60bd4870 100644
+--- a/src/redir.c
++++ b/src/redir.c
+@@ -147,7 +147,7 @@ create_and_bind(const char *addr, const char *port)
+ {
+ struct addrinfo hints;
+ struct addrinfo *result, *rp;
+- int s, listen_sock;
++ int s, listen_sock = -1;
+
+ memset(&hints, 0, sizeof(struct addrinfo));
+ hints.ai_family = AF_UNSPEC; /* Return IPv4 and IPv6 choices */
+diff --git a/src/server.c b/src/server.c
+index e9cdc2619..073e38b22 100644
+--- a/src/server.c
++++ b/src/server.c
+@@ -550,7 +550,7 @@ create_and_bind(const char *host, const char *port, int mptcp)
+ {
+ struct addrinfo hints;
+ struct addrinfo *result, *rp, *ipv4v6bindall;
+- int s, listen_sock;
++ int s, listen_sock = -1;
+
+ memset(&hints, 0, sizeof(struct addrinfo));
+ hints.ai_family = AF_UNSPEC; /* Return IPv4 and IPv6 choices */
+diff --git a/src/tunnel.c b/src/tunnel.c
+index e0886bdb9..6641fe62a 100644
+--- a/src/tunnel.c
++++ b/src/tunnel.c
+@@ -129,7 +129,7 @@ create_and_bind(const char *addr, const char *port)
+ {
+ struct addrinfo hints;
+ struct addrinfo *result, *rp;
+- int s, listen_sock;
++ int s, listen_sock = -1;
+
+ memset(&hints, 0, sizeof(struct addrinfo));
+ hints.ai_family = AF_UNSPEC; /* Return IPv4 and IPv6 choices */
+diff --git a/src/udprelay.c b/src/udprelay.c
+index 23a042497..580ad4bd8 100644
+--- a/src/udprelay.c
++++ b/src/udprelay.c
+@@ -446,7 +446,7 @@ create_server_socket(const char *host, const char *port)
+ {
+ struct addrinfo hints;
+ struct addrinfo *result, *rp, *ipv4v6bindall;
+- int s, server_sock;
++ int s, server_sock = -1;
+
+ memset(&hints, 0, sizeof(struct addrinfo));
+ hints.ai_family = AF_UNSPEC; /* Return IPv4 and IPv6 choices */
--
2.35.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/shadowsocks-libev: fix maybe-uninitialized errors
2022-04-11 16:21 [Buildroot] [PATCH 1/1] package/shadowsocks-libev: fix maybe-uninitialized errors Fabrice Fontaine
@ 2022-04-21 17:54 ` Arnout Vandecappelle
2022-05-23 10:57 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle @ 2022-04-21 17:54 UTC (permalink / raw)
To: Fabrice Fontaine, buildroot; +Cc: Min Xu
On 11/04/2022 18:21, Fabrice Fontaine wrote:
> Fix the following build failure:
>
> local.c: In function 'create_and_bind':
> local.c:218:12: error: 'listen_sock' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> 218 | return listen_sock;
> | ^~~~~~~~~~~
>
> Fixes:
> - http://autobuild.buildroot.org/results/27471a878ff52a972ac087d534e44fb0c50808f6
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Applied to master, thanks.
Regards,
Arnout
> ---
> .../0002-fix-maybe-uninitialized-errors.patch | 93 +++++++++++++++++++
> 1 file changed, 93 insertions(+)
> create mode 100644 package/shadowsocks-libev/0002-fix-maybe-uninitialized-errors.patch
>
> diff --git a/package/shadowsocks-libev/0002-fix-maybe-uninitialized-errors.patch b/package/shadowsocks-libev/0002-fix-maybe-uninitialized-errors.patch
> new file mode 100644
> index 0000000000..5275323e65
> --- /dev/null
> +++ b/package/shadowsocks-libev/0002-fix-maybe-uninitialized-errors.patch
> @@ -0,0 +1,93 @@
> +From 0c23224e926463b1097414979367655a27fa6d60 Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Thu, 7 Apr 2022 18:27:58 +0200
> +Subject: [PATCH] fix maybe-uninitialized errors
> +
> +Set {listen,server}_sock to -1 when needed as already done in
> +src/manager.c by commit ecf1fcc84594b09ed2d61e3677cd8e62bd897ccb to
> +avoid the following build failure:
> +
> +local.c: In function 'create_and_bind':
> +local.c:218:12: error: 'listen_sock' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> + 218 | return listen_sock;
> + | ^~~~~~~~~~~
> +
> +Fixes:
> + - http://autobuild.buildroot.org/results/27471a878ff52a972ac087d534e44fb0c50808f6
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +[Retrieved from:
> +https://github.com/shadowsocks/shadowsocks-libev/commit/0c23224e926463b1097414979367655a27fa6d60]
> +---
> + src/local.c | 2 +-
> + src/redir.c | 2 +-
> + src/server.c | 2 +-
> + src/tunnel.c | 2 +-
> + src/udprelay.c | 2 +-
> + 5 files changed, 5 insertions(+), 5 deletions(-)
> +
> +diff --git a/src/local.c b/src/local.c
> +index b1ab040bb..47d634ce5 100644
> +--- a/src/local.c
> ++++ b/src/local.c
> +@@ -168,7 +168,7 @@ create_and_bind(const char *addr, const char *port)
> + {
> + struct addrinfo hints;
> + struct addrinfo *result, *rp;
> +- int s, listen_sock;
> ++ int s, listen_sock = -1;
> +
> + memset(&hints, 0, sizeof(struct addrinfo));
> + hints.ai_family = AF_UNSPEC; /* Return IPv4 and IPv6 choices */
> +diff --git a/src/redir.c b/src/redir.c
> +index 4a5a489f0..e60bd4870 100644
> +--- a/src/redir.c
> ++++ b/src/redir.c
> +@@ -147,7 +147,7 @@ create_and_bind(const char *addr, const char *port)
> + {
> + struct addrinfo hints;
> + struct addrinfo *result, *rp;
> +- int s, listen_sock;
> ++ int s, listen_sock = -1;
> +
> + memset(&hints, 0, sizeof(struct addrinfo));
> + hints.ai_family = AF_UNSPEC; /* Return IPv4 and IPv6 choices */
> +diff --git a/src/server.c b/src/server.c
> +index e9cdc2619..073e38b22 100644
> +--- a/src/server.c
> ++++ b/src/server.c
> +@@ -550,7 +550,7 @@ create_and_bind(const char *host, const char *port, int mptcp)
> + {
> + struct addrinfo hints;
> + struct addrinfo *result, *rp, *ipv4v6bindall;
> +- int s, listen_sock;
> ++ int s, listen_sock = -1;
> +
> + memset(&hints, 0, sizeof(struct addrinfo));
> + hints.ai_family = AF_UNSPEC; /* Return IPv4 and IPv6 choices */
> +diff --git a/src/tunnel.c b/src/tunnel.c
> +index e0886bdb9..6641fe62a 100644
> +--- a/src/tunnel.c
> ++++ b/src/tunnel.c
> +@@ -129,7 +129,7 @@ create_and_bind(const char *addr, const char *port)
> + {
> + struct addrinfo hints;
> + struct addrinfo *result, *rp;
> +- int s, listen_sock;
> ++ int s, listen_sock = -1;
> +
> + memset(&hints, 0, sizeof(struct addrinfo));
> + hints.ai_family = AF_UNSPEC; /* Return IPv4 and IPv6 choices */
> +diff --git a/src/udprelay.c b/src/udprelay.c
> +index 23a042497..580ad4bd8 100644
> +--- a/src/udprelay.c
> ++++ b/src/udprelay.c
> +@@ -446,7 +446,7 @@ create_server_socket(const char *host, const char *port)
> + {
> + struct addrinfo hints;
> + struct addrinfo *result, *rp, *ipv4v6bindall;
> +- int s, server_sock;
> ++ int s, server_sock = -1;
> +
> + memset(&hints, 0, sizeof(struct addrinfo));
> + hints.ai_family = AF_UNSPEC; /* Return IPv4 and IPv6 choices */
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/shadowsocks-libev: fix maybe-uninitialized errors
2022-04-11 16:21 [Buildroot] [PATCH 1/1] package/shadowsocks-libev: fix maybe-uninitialized errors Fabrice Fontaine
2022-04-21 17:54 ` Arnout Vandecappelle
@ 2022-05-23 10:57 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2022-05-23 10:57 UTC (permalink / raw)
To: Fabrice Fontaine; +Cc: Min Xu, buildroot
>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:
> Fix the following build failure:
> local.c: In function 'create_and_bind':
> local.c:218:12: error: 'listen_sock' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> 218 | return listen_sock;
> | ^~~~~~~~~~~
> Fixes:
> - http://autobuild.buildroot.org/results/27471a878ff52a972ac087d534e44fb0c50808f6
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Committed to 2022.02.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-05-23 10:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11 16:21 [Buildroot] [PATCH 1/1] package/shadowsocks-libev: fix maybe-uninitialized errors Fabrice Fontaine
2022-04-21 17:54 ` Arnout Vandecappelle
2022-05-23 10:57 ` Peter Korsgaard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.