From 950b1105158e1a48beb334f5e7cb99fc173c3d85 Mon Sep 17 00:00:00 2001 From: midipix Date: Tue, 5 Mar 2024 02:38:05 +0000 Subject: slbt_obtain_nminfo(): verify successful creation of output file before fork(). --- src/arbits/slbt_archive_syminfo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3