Gitweb:
http://git.fedorahosted.org/git/?p=dlm.git;a=commitdiff;h=fcc60e8f89908ca...
Commit: fcc60e8f89908cabd294bbd37537de3b566c4105
Parent: e7883bea402d425f176dc4176bf5123acc84e153
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Jun 12 15:25:50 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Jun 12 15:25:50 2012 -0500
dlm_tool: clear name buffer in output
could end up printing some garbage after the name
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_tool/main.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlm_tool/main.c b/dlm_tool/main.c
index 608ee49..7ce9395 100644
--- a/dlm_tool/main.c
+++ b/dlm_tool/main.c
@@ -875,7 +875,7 @@ static void do_waiters(char *name, struct summary *sum)
FILE *file;
char path[PATH_MAX];
char line[LOCK_LINE_MAX];
- char rname[65];
+ char rname[DLM_RESNAME_MAXLEN+1];
int header = 0;
int i, j, spaces;
int rv, nodeid, wait_type;
@@ -905,6 +905,7 @@ static void do_waiters(char *name, struct summary *sum)
/* parse the resource name from the remainder of the line */
j = 0;
spaces = 0;
+ memset(rname, 0, sizeof(rname));
for (i = 0; i < LOCK_LINE_MAX; i++) {
if (line[i] == '\n')
@@ -1043,7 +1044,7 @@ static void do_lockdump(char *name)
FILE *file;
char path[PATH_MAX];
char line[LOCK_LINE_MAX];
- char r_name[65];
+ char r_name[DLM_RESNAME_MAXLEN+1];
int r_nodeid;
int r_len;
int rv;