summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-transport
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2013-12-24 17:58:21 +0530
committerVijay Bellur <vbellur@redhat.com>2013-12-26 03:36:30 -0800
commitd4b8825436daad701995e120f38da706e5fe97c1 (patch)
tree0c358fcdd8118b054f1d6c5cddbedadd0a6bdc05 /rpc/rpc-transport
parent0d7279d32d5f55c0210bdcfda2d3f83e35f524b6 (diff)
socket: unix socket connect path can't be greater than UNIX_PATH_MAX characters
Change-Id: I74788b63dd1c14507aa6d65182ea4b87a2e1f389 BUG: 1046308 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/6589 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'rpc/rpc-transport')
-rw-r--r--rpc/rpc-transport/socket/src/name.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rpc/rpc-transport/socket/src/name.c b/rpc/rpc-transport/socket/src/name.c
index 1647d5b6b64..c6eae9739ad 100644
--- a/rpc/rpc-transport/socket/src/name.c
+++ b/rpc/rpc-transport/socket/src/name.c
@@ -285,7 +285,7 @@ af_unix_client_get_remote_sockaddr (rpc_transport_t *this,
goto err;
}
- if (strlen (connect_path) > UNIX_PATH_MAX) {
+ if ((strlen (connect_path) + 1) > UNIX_PATH_MAX) {
gf_log (this->name, GF_LOG_ERROR,
"connect-path value length %"GF_PRI_SIZET" > %d octets",
strlen (connect_path), UNIX_PATH_MAX);
@@ -329,7 +329,7 @@ af_unix_server_get_local_sockaddr (rpc_transport_t *this,
#define UNIX_PATH_MAX 108
#endif
- if (strlen (listen_path) > UNIX_PATH_MAX) {
+ if ((strlen (listen_path) + 1) > UNIX_PATH_MAX) {
gf_log (this->name, GF_LOG_ERROR,
"option transport.unix.listen-path has value length "
"%"GF_PRI_SIZET" > %d",