]> git.ipfire.org Git - thirdparty/strongswan.git/commit
settings: Use dirname(3) correctly
authorTobias Brunner <tobias@strongswan.org>
Fri, 21 Feb 2014 13:58:01 +0000 (14:58 +0100)
committerTobias Brunner <tobias@strongswan.org>
Mon, 24 Feb 2014 11:03:49 +0000 (12:03 +0100)
commitcaf1770905e81b95fbe7f3e9125f24719368c3e9
treed9f8ae0325fc4fa3615a2e9ff049f46b851edb86
parenta21d4096e56c81f1d71b5d891a85069ff6c1cb4d
settings: Use dirname(3) correctly

dirname(3) may return a pointer to a statically allocated buffer.
So freeing the returned value can result to undefined behavior. This was
noticed on FreeBSD where it caused very strange crashes.

It is also not thread-safe, which will be addressed later.
src/libstrongswan/utils/settings.c