if krb5_get_default_config_files() returns success and
authorSam Hartman <hartmans@mit.edu>
Wed, 28 Sep 2011 20:54:49 +0000 (20:54 +0000)
committerSam Hartman <hartmans@mit.edu>
Wed, 28 Sep 2011 20:54:49 +0000 (20:54 +0000)
an empty list, then get_profile_file() will attempt
to dereference a null pointer.  check for the empty
list and treat it as failure.

Patch by Jeffrey Altman.

From: Alexey Melnikov <alexey.melnikov@isode.com>

leashw32: get_profile_file

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25250 dc483132-0cff-0310-8789-dd5450dbe970

src/windows/leashdll/lshfunc.c

index a9c7c0d4c9f3bea573acdb79dddfb44a572e430a..91920e0ecb28f945f658ee8d76750b0683ba9b28 100644 (file)
@@ -1553,7 +1553,7 @@ get_profile_file(LPSTR confname, UINT szConfname)
 {
     char **configFile = NULL;
     if (hKrb5) {
-        if (pkrb5_get_default_config_files(&configFile))
+        if (pkrb5_get_default_config_files(&configFile) || !configFile[0])
         {
             GetWindowsDirectory(confname,szConfname);
             confname[szConfname-1] = '\0';