From: Ben Collins Date: Wed, 13 Sep 2000 21:44:37 +0000 (+0000) Subject: init output_string to NULL, and check in printbase() to make sure we don't pass garbage X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2025 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=85747c5c55b896d4337d54fb76ce3992e70d594f;p=openldap init output_string to NULL, and check in printbase() to make sure we don't pass garbage --- diff --git a/clients/ud/main.c b/clients/ud/main.c index aebf89c4dc..4e2dac8adb 100644 --- a/clients/ud/main.c +++ b/clients/ud/main.c @@ -331,7 +331,7 @@ change_base( int type, char **base, char *s ) { register char *cp; /* utility pointers */ char **rdns; /* for parsing */ - char *output_string; /* for nice output */ + char *output_string = NULL; /* for nice output */ int num_picked; /* # of selected base */ int j; /* used with num_picked */ int i = 1; /* index into choices array */ diff --git a/clients/ud/util.c b/clients/ud/util.c index 16253263a4..6505f52ecc 100644 --- a/clients/ud/util.c +++ b/clients/ud/util.c @@ -44,6 +44,10 @@ printbase( char *lead, char *s ) if (debug & D_TRACE) printf("->printbase(%s, %s)\n", lead, s); #endif + if (lead == NULL) { + printf("root"); + return; + } if (s == NULL) { printf("%sroot\n", lead); return;