]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix profile crash on memory exhaustion 1273/head
authorChenChen Zhou <357726167@qq.com>
Thu, 24 Nov 2022 13:59:21 +0000 (21:59 +0800)
committerGreg Hudson <ghudson@mit.edu>
Mon, 5 Dec 2022 16:19:05 +0000 (11:19 -0500)
In profile_get_values(), if init_list() fails to allocate values.list,
end_list() will dereference a null pointer.  Fix end_list() to handle
list->list being null.

[ghudson@mit.edu: rewrote commit message]

ticket: 9078 (new)

src/util/profile/prof_get.c

index 0e14200cab313579533a2e769c7c7ee56d0ffa2f..12c7b9641d1f1280fdbf3f72f2207218b0de4622 100644 (file)
@@ -62,7 +62,7 @@ static void end_list(struct profile_string_list *list, char ***ret_list)
         *ret_list = list->list;
         return;
     } else {
-        for (cp = list->list; *cp; cp++)
+        for (cp = list->list; cp && *cp; cp++)
             free(*cp);
         free(list->list);
     }