summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2015-10-23 20:45:21 +0200
committerJulian Andres Klode <jak@debian.org>2015-10-30 14:20:24 +0100
commit2609e7cea39fb32a999acef014ea9ce6e9b3d141 (patch)
treee5081b9fb744d79671f13d5c4245cbbc672e0a0f /apt-pkg
parent1843d82ff5f8712778062cc08ed991e1dee42b6e (diff)
dpkgpm: Convert ctime() call to ctime_r()
ctime() is not thread-safe, ctime_r() is. Gbp-Dch: ignore
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/deb/dpkgpm.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 8f652b3df..0f195b921 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -1839,7 +1839,8 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
fprintf(report, "ProblemType: Package\n");
fprintf(report, "Architecture: %s\n", arch.c_str());
time_t now = time(NULL);
- fprintf(report, "Date: %s" , ctime(&now));
+ char ctime_buf[26]; // need at least 26 bytes according to ctime(3)
+ fprintf(report, "Date: %s" , ctime_r(&now, ctime_buf));
fprintf(report, "Package: %s %s\n", pkgname.c_str(), pkgver.c_str());
fprintf(report, "SourcePackage: %s\n", Ver.SourcePkgName());
fprintf(report, "ErrorMessage:\n %s\n", errormsg);