git://git.exim.org
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ea97267
)
Check return from asprintf()
author
Jeremy Harris
<jgh146exb@wizmail.org>
Sun, 23 Sep 2018 14:44:15 +0000
(15:44 +0100)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Sun, 23 Sep 2018 15:01:36 +0000
(16:01 +0100)
src/src/exim_dbutil.c
patch
|
blob
|
history
diff --git
a/src/src/exim_dbutil.c
b/src/src/exim_dbutil.c
index 17da205b4e2f500de7995b3de247402d879a07af..a33c59c08bc229f82e81f3f59dcfa3dcc39d6246 100644
(file)
--- a/
src/src/exim_dbutil.c
+++ b/
src/src/exim_dbutil.c
@@
-260,8
+260,9
@@
ensures that Exim has exclusive use of the database before it even tries to
open it. If there is a database, there should be a lock file in existence. */
#ifdef COMPILE_UTILITY
open it. If there is a database, there should be a lock file in existence. */
#ifdef COMPILE_UTILITY
-asprintf(CSS &dirname, "%s/db", spool_directory);
-asprintf(CSS &filename, "%s/%s.lockfile", dirname, name);
+if ( asprintf(CSS &dirname, "%s/db", spool_directory) < 0
+ || asprintf(CSS &filename, "%s/%s.lockfile", dirname, name) < 0)
+ return NULL;
#else
dirname = string_sprintf("%s/db", spool_directory);
filename = string_sprintf("%s/%s.lockfile", dirname, name);
#else
dirname = string_sprintf("%s/db", spool_directory);
filename = string_sprintf("%s/%s.lockfile", dirname, name);
@@
-302,7
+303,7
@@
if (rc < 0)
exclusive access to the database, so we can go ahead and open it. */
#ifdef COMPILE_UTILITY
exclusive access to the database, so we can go ahead and open it. */
#ifdef COMPILE_UTILITY
-
asprintf(CSS &filename, "%s/%s", dirname, name)
;
+
if (asprintf(CSS &filename, "%s/%s", dirname, name) < 0) return NULL
;
#else
filename = string_sprintf("%s/%s", dirname, name);
#endif
#else
filename = string_sprintf("%s/%s", dirname, name);
#endif