diff options
author | Tiago Cunha <tcunha@gmx.com> | 2012-04-24 16:22:28 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2012-04-24 16:22:28 +0000 |
commit | 995c9a50ab7e68eba9d47fd8fd30313046330f21 (patch) | |
tree | cffe6cf976f13344ff90cea6cb2ce60e64a8a745 | |
parent | c8c6a23d66404b82e525e97d3d534e5394669778 (diff) | |
download | rtmux-995c9a50ab7e68eba9d47fd8fd30313046330f21.tar.gz rtmux-995c9a50ab7e68eba9d47fd8fd30313046330f21.tar.bz2 rtmux-995c9a50ab7e68eba9d47fd8fd30313046330f21.zip |
Sync OpenBSD patchset 1099:
Do not return a buffer on the stack, mentioned by jsg a while ago.
-rw-r--r-- | cmd.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1324,8 +1324,10 @@ find_home: return (s->cwd); complete_path: - if (root[skip] == '\0') - return (root); + if (root[skip] == '\0') { + strlcpy(path, root, sizeof path); + return (path); + } n = snprintf(path, sizeof path, "%s/%s", root, cwd + skip); if (n > 0 && (size_t)n < sizeof path) return (path); |