From 2348b8ae6ce02f83069d01478a31bb2498cc6183 Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Thu, 16 Aug 2018 14:15:27 +0300 Subject: glusterfsd/src/glusterfsd.c : reduce size or re-scope message variable The the error and/or message variable was either: - Reduced in size - from 2048 bytes to 64 bytes, for example. or - Changed in scope - defined in a smaller scope. Compile-tested only! Change-Id: I20b9fb3407a74ba96fcbc7f05fcab534ff562c09 updates: bz#1193929 Signed-off-by: Yaniv Kaul --- glusterfsd/src/glusterfsd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'glusterfsd') diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index d4b3a1139ad..5497f592ea6 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -911,7 +911,6 @@ parse_opts (int key, char *arg, struct argp_state *state) double d = 0.0; gf_boolean_t b = _gf_false; char *pwd = NULL; - char tmp_buf[2048] = {0,}; char *tmp_str = NULL; char *port_str = NULL; struct passwd *pw = NULL; @@ -1000,7 +999,8 @@ parse_opts (int key, char *arg, struct argp_state *state) errno); break; } - snprintf (tmp_buf, 1024, "%s/%s", pwd, arg); + char tmp_buf[1024]; + snprintf (tmp_buf, sizeof(tmp_buf), "%s/%s", pwd, arg); cmd_args->volfile = gf_strdup (tmp_buf); free (pwd); } else { -- cgit