summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-03-05 02:38:05 +0000
committermidipix <writeonce@midipix.org>2024-03-05 02:38:05 +0000
commit950b1105158e1a48beb334f5e7cb99fc173c3d85 (patch)
treee507aa7f7158c31503cba2450dc163ccdf3eb7dd
parent926d54732abf235cd099e496ec4bc98edffb1fbf (diff)
downloadslibtool-950b1105158e1a48beb334f5e7cb99fc173c3d85.tar.bz2
slibtool-950b1105158e1a48beb334f5e7cb99fc173c3d85.tar.xz
slbt_obtain_nminfo(): verify successful creation of output file before fork().
-rw-r--r--src/arbits/slbt_archive_syminfo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/arbits/slbt_archive_syminfo.c b/src/arbits/slbt_archive_syminfo.c
index f3857eb..1d7fffd 100644
--- a/src/arbits/slbt_archive_syminfo.c
+++ b/src/arbits/slbt_archive_syminfo.c
@@ -109,7 +109,8 @@ static int slbt_obtain_nminfo(
strcpy(&output[pos],".nm");
/* fork */
- fdout = openat(fdcwd,output,O_CREAT|O_TRUNC|O_WRONLY,0644);
+ if ((fdout = openat(fdcwd,output,O_CREAT|O_TRUNC|O_WRONLY,0644)) < 0)
+ return SLBT_SYSTEM_ERROR(dctx,output);
if ((pid = fork()) < 0) {
close(fdout);