]> git.zerfleddert.de Git - rigol/commitdiff
fix off by one
authorMichael Gernoth <michael@gernoth.net>
Thu, 10 Jun 2010 21:06:56 +0000 (23:06 +0200)
committerMichael Gernoth <michael@gernoth.net>
Thu, 10 Jun 2010 21:06:56 +0000 (23:06 +0200)
scope.c

diff --git a/scope.c b/scope.c
index 30f175a7de8f9a7ceea01f28b4d0f8b1082f932e..eab7750c64c76fa8dd3dbb76354f2a8d03e74d64 100644 (file)
--- 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;
 
        unsigned char *buf;
        int res;
 
-       buf = malloc(maxlen);
+       buf = malloc(maxlen+1);
        if (buf == NULL) {
                perror("malloc(scope_get_strings)");
                exit(EXIT_FAILURE);
        if (buf == NULL) {
                perror("malloc(scope_get_strings)");
                exit(EXIT_FAILURE);
Impressum, Datenschutz