summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-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;