]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
rpc_server: Fix a -Werror=format-truncation error
authorVolker Lendecke <vl@samba.org>
Tue, 9 Feb 2021 11:26:20 +0000 (12:26 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 16 Mar 2021 17:09:32 +0000 (17:09 +0000)
gcc gets this wrong, it believes %u can write up to
"2147483647" (2^31-1). Silence this with an easy patch.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/rpc_server/rpc_sock_helper.c

index 4b998962c8e9f53aebd941e944d8c9180d1ad2eb..5756a89154418770225aefcfbddb16bd05f0b57e 100644 (file)
@@ -160,7 +160,7 @@ static NTSTATUS dcesrv_create_ncacn_ip_tcp_sockets(
        int **pfds)
 {
        uint16_t port = 0;
-       char port_str[6];
+       char port_str[11];
        const char *endpoint = NULL;
        size_t i = 0, num_fds;
        int *fds = NULL;