summaryrefslogtreecommitdiffstats
path: root/abs/extra/mc/mc-4.6.1-invalid-mtime.patch
diff options
context:
space:
mode:
authorCecil Hugh Watson <knoppmyth@gmail.com>2009-09-26 01:57:08 (GMT)
committerCecil Hugh Watson <knoppmyth@gmail.com>2009-09-26 01:57:08 (GMT)
commit7b29169fff9e7c624890c5edffe85def8a293136 (patch)
tree47753889faa3a2063b66d1c7e7681e703eb1b39a /abs/extra/mc/mc-4.6.1-invalid-mtime.patch
parentc491dea779dac29afff3578bf8245943817c2339 (diff)
downloadlinhes_pkgbuild-7b29169fff9e7c624890c5edffe85def8a293136.zip
linhes_pkgbuild-7b29169fff9e7c624890c5edffe85def8a293136.tar.gz
linhes_pkgbuild-7b29169fff9e7c624890c5edffe85def8a293136.tar.bz2
LinHES 6.01.00
Diffstat (limited to 'abs/extra/mc/mc-4.6.1-invalid-mtime.patch')
-rw-r--r--abs/extra/mc/mc-4.6.1-invalid-mtime.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/abs/extra/mc/mc-4.6.1-invalid-mtime.patch b/abs/extra/mc/mc-4.6.1-invalid-mtime.patch
new file mode 100644
index 0000000..07b1f6d
--- /dev/null
+++ b/abs/extra/mc/mc-4.6.1-invalid-mtime.patch
@@ -0,0 +1,30 @@
+
+ Invalid timestamps on files caused mc to segfault by passing a null
+ pointer to strftime. Avoid trying to print the time in this case.
+
+ Reported by Maxim Britov <maxim@office.modum.by>
+ at http://bugs.gentoo.org/184296
+
+--- mc-4.6.1/src/util.c
++++ mc-4.6.1/src/util.c
+@@ -717,6 +717,7 @@
+ static size_t i18n_timelength = 0;
+ static const char *fmtyear, *fmttime;
+ const char *fmt;
++ struct tm *whentm;
+
+ if (i18n_timelength == 0){
+ i18n_timelength = i18n_checktimelength() + 1;
+@@ -740,7 +741,11 @@
+ else
+ fmt = fmttime;
+
+- strftime (timebuf, i18n_timelength, fmt, localtime(&when));
++ whentm = localtime(&when);
++ if (whentm == NULL)
++ return "(invalid)";
++
++ strftime (timebuf, i18n_timelength, fmt, whentm);
+ return timebuf;
+ }
+