* main.c (initialize_realms): Use precise size allocation for dbname= parameter
authorKen Raeburn <raeburn@mit.edu>
Sat, 13 May 2006 06:41:37 +0000 (06:41 +0000)
committerKen Raeburn <raeburn@mit.edu>
Sat, 13 May 2006 06:41:37 +0000 (06:41 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18007 dc483132-0cff-0310-8789-dd5450dbe970

src/kdc/main.c

index d03b81e0390ff0fc2b46be03e2406d8634210cd2..7bdc96033ffc30f5b9d8765e2c6d5a6f8ea35a7e 100644 (file)
@@ -503,7 +503,7 @@ initialize_realms(krb5_context kcontext, int argc, char **argv)
            /* now db_name is not a seperate argument. It has to be passed as part of the db_args */
            if( db_name == NULL )
            {
-               db_name = malloc(1025);
+               db_name = malloc(sizeof("dbname=") + strlen(optarg));
                if( db_name == NULL )
                {
                        fprintf(stderr,"%s: KDC cannot initialize. Not enough memory\n",