The Samba-Bugzilla – Attachment 14366 Details for
Bug 13545
Fix CTDB compilation issues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patches for 4.9.x
BZ13545-v4-9.patch (text/plain), 3.21 KB, created by
Amitay Isaacs
on 2018-07-30 03:55:13 UTC
(
hide
)
Description:
Patches for 4.9.x
Filename:
MIME Type:
Creator:
Amitay Isaacs
Created:
2018-07-30 03:55:13 UTC
Size:
3.21 KB
patch
obsolete
>From e3cf7302749db26153846cd47d29f5d2b5c6218a Mon Sep 17 00:00:00 2001 >From: Martin Schwenke <martin@meltin.net> >Date: Thu, 26 Jul 2018 11:00:28 +1000 >Subject: [PATCH 1/2] ctdb-common: Fix compilation issue with strncpy() >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >When configured with --picky-developer and using -O3 with gcc 8.1: > >../common/system_socket.c: In function âparse_ip_maskâ: >../common/system_socket.c:229:2: error: âstrncpyâ specified bound depends on the length of the source argument [-Werror=stringop-overflow=] > strncpy(s, str, len+1); > ^~~~~~~~~~~~~~~~~~~~~~ >../common/system_socket.c:223:8: note: length computed here > len = strlen(str); > ^~~~~~~~~~~ > >Use strlcpy() instead and check the result. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13545 > >Signed-off-by: Martin Schwenke <martin@meltin.net> >Reviewed-by: Amitay Isaacs <amitay@gmail.com> >(cherry picked from commit 5dd84bf5d73e4afab094834bc317da7884b9b9b3) >--- > ctdb/common/system_socket.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > >diff --git a/ctdb/common/system_socket.c b/ctdb/common/system_socket.c >index 4e43805ca38..62cc782a224 100644 >--- a/ctdb/common/system_socket.c >+++ b/ctdb/common/system_socket.c >@@ -220,14 +220,12 @@ bool parse_ip_mask(const char *str, > > ZERO_STRUCT(*addr); > >- len = strlen(str); >+ len = strlcpy(s, str, sizeof(s)); > if (len >= sizeof(s)) { > DBG_ERR("Address %s is unreasonably long\n", str); > return false; > } > >- strncpy(s, str, len+1); >- > p = rindex(s, '/'); > if (p == NULL) { > DBG_ERR("Address %s does not contain a mask\n", s); >-- >2.17.1 > > >From d721507005204129f7f36c76e05ece0138a9d6fd Mon Sep 17 00:00:00 2001 >From: Martin Schwenke <martin@meltin.net> >Date: Thu, 26 Jul 2018 11:01:30 +1000 >Subject: [PATCH 2/2] ctdb-protocol: Fix compilation issue with strncpy() >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >When configured with --picky-developer and using -O3 with gcc 8.1: > >../protocol/protocol_util.c: In function âctdb_sock_addr_from_stringâ: >../protocol/protocol_util.c:282:2: error: âstrncpyâ specified bound depends on the length of the source argument [-Werror=stringop-overflow=] > strncpy(s, str, len+1); > ^~~~~~~~~~~~~~~~~~~~~~ >../protocol/protocol_util.c:277:8: note: length computed here > len = strlen(str); > ^~~~~~~~~~~ > >Use strlcpy() instead and check the result. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13545 > >Signed-off-by: Martin Schwenke <martin@meltin.net> >Reviewed-by: Amitay Isaacs <amitay@gmail.com> >(cherry picked from commit 3b56f2002a35b55b46958178c79aee519f0c5880) >--- > ctdb/protocol/protocol_util.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > >diff --git a/ctdb/protocol/protocol_util.c b/ctdb/protocol/protocol_util.c >index 77e79867443..a0127a643bc 100644 >--- a/ctdb/protocol/protocol_util.c >+++ b/ctdb/protocol/protocol_util.c >@@ -276,13 +276,11 @@ int ctdb_sock_addr_from_string(const char *str, > > /* Parse out port number and then IP address */ > >- len = strlen(str); >+ len = strlcpy(s, str, sizeof(s)); > if (len >= sizeof(s)) { > return EINVAL; > } > >- strncpy(s, str, len+1); >- > p = rindex(s, ':'); > if (p == NULL) { > return EINVAL; >-- >2.17.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
martins
:
review+
Actions:
View
Attachments on
bug 13545
: 14366