diff --git a/src/rxdebug/rxdebug.c b/src/rxdebug/rxdebug.c index e4dcfcf463..3d4bf0a513 100644 --- a/src/rxdebug/rxdebug.c +++ b/src/rxdebug/rxdebug.c @@ -213,6 +213,7 @@ MainCommand(struct cmd_syndesc *as, void *arock) } if (version_flag) { + memset(version, 0, sizeof(version)); code = rx_GetServerVersion(s, host, port, length, version); if (code < 0) { @@ -220,6 +221,7 @@ MainCommand(struct cmd_syndesc *as, void *arock) errno); exit(1); } + version[sizeof(version) - 1] = '\0'; printf("AFS version: %s\n", version); fflush(stdout);