mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-02-23 14:09:39 +08:00
init output_string to NULL, and check in printbase() to make sure we don't pass garbage
This commit is contained in:
parent
66e3b39001
commit
85747c5c55
@ -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 */
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user