summaryrefslogtreecommitdiff
path: root/lib/spawn_int.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-06-10 16:50:04 +0200
committerBruno Haible <bruno@clisp.org>2019-06-10 17:24:58 +0200
commit765146c33361b46aa2c592e980b16069094c6000 (patch)
treeb8cbb15b10cca39202340848c26b980ef838b068 /lib/spawn_int.h
parentfbb40ec10e333cff0b9845572065edd9e66eac79 (diff)
downloadgnulib-765146c33361b46aa2c592e980b16069094c6000.tar.gz
posix_spawn_file_actions_addopen: Fix possible use-after-free bug.
Reported at <https://sourceware.org/bugzilla/show_bug.cgi?id=17048>. * lib/spawn_int.h (struct __spawn_action): Remove 'const' from path. * lib/spawn_faction_addopen.c (posix_spawn_file_actions_addopen): Make a copy of the path argument. * lib/spawn_faction_destroy.c (posix_spawn_file_actions_destroy): Free it.
Diffstat (limited to 'lib/spawn_int.h')
-rw-r--r--lib/spawn_int.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/spawn_int.h b/lib/spawn_int.h
index 584c1bbcc3..08c477a9cb 100644
--- a/lib/spawn_int.h
+++ b/lib/spawn_int.h
@@ -42,7 +42,7 @@ struct __spawn_action
struct
{
int fd;
- const char *path;
+ char *path;
int oflag;
mode_t mode;
} open_action;