[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: do not test address of array against NULL
From: |
Ralf Wildenhues |
Subject: |
FYI: do not test address of array against NULL |
Date: |
Sat, 1 Sep 2007 10:14:28 +0200 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Applied to the respective branches.
Cheers,
Ralf
HEAD:
2007-09-01 Ralf Wildenhues <address@hidden>
* libltdl/ltdl.c (try_dlopen, lt_dlforeachfile): Do not test
array address of sys_dlsearch_path against NULL, rather test for
nonempty contents.
Coverity reports CID 148 and CID 149 via Jeff Squyres.
Index: libltdl/ltdl.c
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/ltdl.c,v
retrieving revision 1.259
diff -u -r1.259 ltdl.c
--- libltdl/ltdl.c 1 Sep 2007 08:10:02 -0000 1.259
+++ libltdl/ltdl.c 1 Sep 2007 08:11:02 -0000
@@ -1311,7 +1311,7 @@
}
#endif
#if defined(LT_DLSEARCH_PATH)
- if (!file && sys_dlsearch_path)
+ if (!file && *sys_dlsearch_path)
{
file = find_file (sys_dlsearch_path, base_name, &dir);
}
@@ -1849,7 +1849,7 @@
}
#endif
#if defined(LT_DLSEARCH_PATH)
- if (!is_done && sys_dlsearch_path)
+ if (!is_done && *sys_dlsearch_path)
{
is_done = foreach_dirinpath (sys_dlsearch_path, 0,
foreachfile_callback, fpptr, data);
branch-1-5:
2007-09-01 Ralf Wildenhues <address@hidden>
* libltdl/ltdl.c (try_dlopen): Do not test array address of
sys_dlsearch_path against NULL, rather test for nonempty
contents.
Coverity reports CID 148 and CID 149 via Jeff Squyres.
Index: libltdl/ltdl.c
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/ltdl.c,v
retrieving revision 1.174.2.29
diff -u -r1.174.2.29 ltdl.c
--- libltdl/ltdl.c 15 Aug 2007 21:39:26 -0000 1.174.2.29
+++ libltdl/ltdl.c 1 Sep 2007 08:11:45 -0000
@@ -3217,7 +3217,7 @@
}
#endif
#ifdef LTDL_SYSSEARCHPATH
- if (!file && sys_search_path)
+ if (!file && *sys_search_path)
{
file = find_file (sys_search_path, base_name, &dir);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: do not test address of array against NULL,
Ralf Wildenhues <=