tdbtool: fix off-by-one error in argument length. (bug #2344)
authorMichael Adam <obnox@samba.org>
Tue, 8 Jul 2008 14:13:24 +0000 (16:13 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 8 Jul 2008 14:13:24 +0000 (16:13 +0200)
This prevented all commands operating on keys (all non-traverse commands)
in tdbtool to fail with a "fetch failed" or "delete failed" message.

It seems that it fixes bug #2344 ...

Apparently this bug was introduced with 94e53472666ed in 2005.
Either nobody is using tdbtool or else tdb_find() has become
more strict about the key legth in the meantime. :-)

Michael

source/tdb/tools/tdbtool.c

index 4bddf76a233167a194d632a3847f07a0a9adafe9..9592c39a91fb6416ab2e48528deae95d74f4d186 100644 (file)
@@ -633,7 +633,7 @@ static char *convert_string(char *instring, size_t *sizep)
        }
        length++;
     }
-    *sizep = length;
+    *sizep = length + 1;
     return instring;
 }