Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
6d11a0e1
Commit
6d11a0e1
authored
Apr 27, 2014
by
Austin Seipp
Browse files
coverity: Suppress some time-of-check-time-of-use reports
CID 43178 Signed-off-by:
Austin Seipp
<
austin@well-typed.com
>
parent
111b8454
Changes
1
Hide whitespace changes
Inline
Side-by-side
rts/Linker.c
View file @
6d11a0e1
...
...
@@ -2810,6 +2810,7 @@ loadObj( pathchar *path )
/* Check that we haven't already loaded this object.
Ignore requests to load multiple times */
if
(
isAlreadyLoaded
(
path
))
{
IF_DEBUG
(
linker
,
debugBelch
(
"ignoring repeated load of %"
PATH_FMT
"
\n
"
,
path
));
...
...
@@ -2828,8 +2829,10 @@ loadObj( pathchar *path )
/* On many architectures malloc'd memory isn't executable, so we need to use mmap. */
#if defined(openbsd_HOST_OS)
/* coverity[toctou] */
fd
=
open
(
path
,
O_RDONLY
,
S_IRUSR
);
#else
/* coverity[toctou] */
fd
=
open
(
path
,
O_RDONLY
);
#endif
if
(
fd
==
-
1
)
...
...
@@ -2841,6 +2844,7 @@ loadObj( pathchar *path )
#else
/* !USE_MMAP */
/* load the image into memory */
/* coverity[toctou] */
f
=
pathopen
(
path
,
WSTR
(
"rb"
));
if
(
!
f
)
barf
(
"loadObj: can't read `%"
PATH_FMT
"'"
,
path
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment