From e60849a50f3cd7093fca68cffe265b73a5ea9fd8 Mon Sep 17 00:00:00 2001 From: David Bigagli <david@schedmd.com> Date: Tue, 29 Jan 2013 09:24:05 -0800 Subject: [PATCH] Fix for write off end of allocated memory --- src/common/gres.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/gres.c b/src/common/gres.c index 2b2d2eec9c8..450b31d5077 100644 --- a/src/common/gres.c +++ b/src/common/gres.c @@ -534,7 +534,7 @@ static char *_get_gres_conf(void) return xstrdup(GRES_CONFIG_FILE); /* Replace file name on end of path */ - i = strlen(val) - strlen("slurm.conf") + strlen("gres.conf") + 1; + i = strlen(val) - strlen("slurm.conf") + strlen("gres.conf") + 2; rc = xmalloc(i); strcpy(rc, val); val = strrchr(rc, (int)'/'); -- GitLab