summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-06-15 11:44:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:28 -0500
commitc56f00252528e236f6e9f4db588ec092c93d9c2a (patch)
tree2e05395e678d2124a2e45b93d09aa42ef2c1c609 /source3/utils
parentd93b40867893cedbac32970ddb38701479807e29 (diff)
downloadsamba-c56f00252528e236f6e9f4db588ec092c93d9c2a.tar.gz
samba-c56f00252528e236f6e9f4db588ec092c93d9c2a.tar.bz2
samba-c56f00252528e236f6e9f4db588ec092c93d9c2a.zip
r16252: Fix Klocwork ID 1119, 1121.
Volker (This used to be commit 678bbcf06109b276d3e4514c3788a9fb31348de0)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/pdbedit.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c
index 7d95d15bf2..0a6fb7e8be 100644
--- a/source3/utils/pdbedit.c
+++ b/source3/utils/pdbedit.c
@@ -628,6 +628,11 @@ static int new_machine (struct pdb_methods *in, const char *machine_in)
get_global_sam_sid();
+ if (strlen(machine_in) == 0) {
+ fprintf(stderr, "No machine name given\n");
+ return -1;
+ }
+
fstrcpy(machinename, machine_in);
machinename[15]= '\0';
@@ -708,6 +713,11 @@ static int delete_machine_entry (struct pdb_methods *in, const char *machinename
{
fstring name;
struct samu *samaccount = NULL;
+
+ if (strlen(machinename) == 0) {
+ fprintf(stderr, "No machine name given\n");
+ return -1;
+ }
fstrcpy(name, machinename);
name[15] = '\0';