diff options
author | David Teigland <teigland@redhat.com> | 2015-05-21 13:12:25 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2015-05-28 16:36:16 -0500 |
commit | 1d014e39251eb46e67d610c75f34d2fb7ee25250 (patch) | |
tree | 1a15ac6b28cba347b30d3e3c08d1358d4d2f755e | |
parent | 38d63df99c693cc2565eb234057433a6ec48fd41 (diff) | |
download | lvm2-1d014e39251eb46e67d610c75f34d2fb7ee25250.tar.gz |
lvmlockd: apply consistent buffer strategy to client
-rw-r--r-- | daemons/lvmlockd/lvmlockd-core.c | 2 | ||||
-rw-r--r-- | daemons/lvmlockd/lvmlockd-internal.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/daemons/lvmlockd/lvmlockd-core.c b/daemons/lvmlockd/lvmlockd-core.c index ad32998e8..7e07c392f 100644 --- a/daemons/lvmlockd/lvmlockd-core.c +++ b/daemons/lvmlockd/lvmlockd-core.c @@ -3962,7 +3962,7 @@ static void client_recv_action(struct client *cl) /* TODO: do this in hello message instead */ if (!cl->name[0] && cl_name) - strncpy(cl->name, cl_name, MAX_NAME-1); + strncpy(cl->name, cl_name, MAX_NAME); if (!gl_use_dlm && !gl_use_sanlock && (lm > 0)) { if (lm == LD_LM_DLM) diff --git a/daemons/lvmlockd/lvmlockd-internal.h b/daemons/lvmlockd/lvmlockd-internal.h index 08286d53e..c24725ee2 100644 --- a/daemons/lvmlockd/lvmlockd-internal.h +++ b/daemons/lvmlockd/lvmlockd-internal.h @@ -82,7 +82,7 @@ struct client { unsigned int recv : 1; unsigned int dead : 1; unsigned int poll_ignore : 1; - char name[MAX_NAME]; + char name[MAX_NAME+1]; }; #define LD_AF_PERSISTENT 0x00000001 |