From 85747c5c55b896d4337d54fb76ce3992e70d594f Mon Sep 17 00:00:00 2001 From: Ben Collins Date: Wed, 13 Sep 2000 21:44:37 +0000 Subject: [PATCH] init output_string to NULL, and check in printbase() to make sure we don't pass garbage --- clients/ud/main.c | 2 +- clients/ud/util.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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; -- 2.39.5