diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2018-09-23 15:44:15 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2018-09-23 16:01:36 +0100 |
commit | 5d520e57a9347e0274fdba9e70b7054d38457f96 (patch) | |
tree | eb52164096ac9f5ea10a9b818c6ce8463408ae8c | |
parent | ea97267cea0f7e6054806504b3616f2bf9723bce (diff) |
Check return from asprintf()
-rw-r--r-- | src/src/exim_dbutil.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/src/exim_dbutil.c b/src/src/exim_dbutil.c index 17da205b4..a33c59c08 100644 --- 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 -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); @@ -302,7 +303,7 @@ if (rc < 0) 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 |