From 759a1836af8a88a8eff08c731a894e380c829f02 Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Thu, 10 Jun 2010 23:06:56 +0200 Subject: [PATCH 1/1] fix off by one --- scope.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scope.c b/scope.c index 30f175a..eab7750 100644 --- a/scope.c +++ b/scope.c @@ -75,7 +75,7 @@ char *scope_get_string(struct scope *sc, char *cmd, int maxlen) unsigned char *buf; int res; - buf = malloc(maxlen); + buf = malloc(maxlen+1); if (buf == NULL) { perror("malloc(scope_get_strings)"); exit(EXIT_FAILURE); -- 2.39.5