1
0
mirror of https://github.com/tmate-io/tmate-ssh-server.git synced 2020-11-18 19:53:51 -08:00

The format callback may not always succeed, so we need to check for

NULL. From Patrick Palka.
This commit is contained in:
nicm 2015-10-27 09:18:06 +00:00
parent 3fc001d0a2
commit 17c2c4219d

View File

@ -643,6 +643,8 @@ format_find(struct format_tree *ft, const char *key, int modifiers)
return (NULL); return (NULL);
found: found:
if (found == NULL)
return (NULL);
copy = xstrdup(found); copy = xstrdup(found);
if (modifiers & FORMAT_BASENAME) { if (modifiers & FORMAT_BASENAME) {
saved = copy; saved = copy;