summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-01-07 22:11:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:06:03 -0500
commit92e85d325f88d4a02ff05d02000e7e3df8ab0e6e (patch)
tree8a38fd40b6e907ab0b333609b4cab7f82b7d88b3
parent96d0d186db42c61fa907b9b24f412b834359e2d8 (diff)
downloadsamba-92e85d325f88d4a02ff05d02000e7e3df8ab0e6e.tar.gz
samba-92e85d325f88d4a02ff05d02000e7e3df8ab0e6e.tar.bz2
samba-92e85d325f88d4a02ff05d02000e7e3df8ab0e6e.zip
r12760: Fix bug 3384
(This used to be commit 9d366da172a13fe9fd6e940f95d58dac534f3b31)
-rw-r--r--source3/tdb/tdbtool.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/source3/tdb/tdbtool.c b/source3/tdb/tdbtool.c
index ce8490ea06..bcfb96adc0 100644
--- a/source3/tdb/tdbtool.c
+++ b/source3/tdb/tdbtool.c
@@ -232,6 +232,11 @@ static void insert_tdb(char *keyname, size_t keylen, char* data, size_t datalen)
{
TDB_DATA key, dbuf;
+ if ((keyname == NULL) || (keylen == 0)) {
+ terror("need key");
+ return;
+ }
+
key.dptr = keyname;
key.dsize = keylen;
dbuf.dptr = data;
@@ -246,6 +251,16 @@ static void store_tdb(char *keyname, size_t keylen, char* data, size_t datalen)
{
TDB_DATA key, dbuf;
+ if ((keyname == NULL) || (keylen == 0)) {
+ terror("need key");
+ return;
+ }
+
+ if ((data == NULL) || (datalen == 0)) {
+ terror("need data");
+ return;
+ }
+
key.dptr = keyname;
key.dsize = keylen;
dbuf.dptr = data;
@@ -263,6 +278,11 @@ static void show_tdb(char *keyname, size_t keylen)
{
TDB_DATA key, dbuf;
+ if ((keyname == NULL) || (keylen == 0)) {
+ terror("need key");
+ return;
+ }
+
key.dptr = keyname;
key.dsize = keylen;
@@ -283,6 +303,11 @@ static void delete_tdb(char *keyname, size_t keylen)
{
TDB_DATA key;
+ if ((keyname == NULL) || (keylen == 0)) {
+ terror("need key");
+ return;
+ }
+
key.dptr = keyname;
key.dsize = keylen;
@@ -296,6 +321,11 @@ static void move_rec(char *keyname, size_t keylen, char* tdbname)
TDB_DATA key, dbuf;
TDB_CONTEXT *dst_tdb;
+ if ((keyname == NULL) || (keylen == 0)) {
+ terror("need key");
+ return;
+ }
+
if ( !tdbname ) {
terror("need destination tdb name");
return;