]> git.ipfire.org Git - thirdparty/krb5.git/commit
Remove klist's defname global variable 1324/head
authorJulien Rische <jrische@redhat.com>
Mon, 8 Jan 2024 15:52:27 +0000 (16:52 +0100)
committerGreg Hudson <ghudson@mit.edu>
Sat, 13 Jan 2024 00:41:12 +0000 (19:41 -0500)
commit5b00197227231943bd2305328c8260dd0b0dbcf0
tree7902577d3dfd27e7572f8f6fbe766fd685f2bfcb
parent52fe67623b7205d91ceac855651e8c17f56b10c8
Remove klist's defname global variable

Addition of a "cleanup" section in kinit's show_ccache() function as
part of commit 6c5471176f5266564fbc8a7e02f03b4b042202f8 introduced a
double-free bug, because defname is a global variable.  After the
first call, successive calls may take place with a dangling pointer in
defname, which will be freed if krb5_cc_get_principal() fails.

Convert "defname" to a local variable initialized at the beginning of
show_ccache().

[ghudson@mit.edu: edited commit message]
src/clients/klist/klist.c