summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Seipp <austin@well-typed.com>2014-04-27 04:19:24 -0500
committerAustin Seipp <austin@well-typed.com>2014-04-27 04:19:27 -0500
commit6d11a0e1400e44e16e0ee7734279c67619442a1d (patch)
tree7ca9f5d61e533e196065be03ede55af4d2fe561a
parent111b8454cc1b64da5b9816b89d79f44a8ae24355 (diff)
downloadhaskell-6d11a0e1400e44e16e0ee7734279c67619442a1d.tar.gz
coverity: Suppress some time-of-check-time-of-use reports
CID 43178 Signed-off-by: Austin Seipp <austin@well-typed.com>
-rw-r--r--rts/Linker.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/rts/Linker.c b/rts/Linker.c
index ab235e9f5c..1b0d48facf 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -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);