Skip to content

Fix segfault when tags file isn't found

Niclas Zeising requested to merge zeising/xedit:zeising/segfault into master

Fix a segfault when the tags file isn't found. xedit tries to construct a path to the tags file (by defailt ${HOME}/tags), using amongst other things basename(3). However, basename is called with an immutable string which causes segfaults on FreeBSD, since basename(3) uses the provided buffer to store it's result. Change the code to duplicate the string with strdup() and call basename on the duplicated string instead.

Merge request reports