Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37493899
en ru br
Репозитории ALT
S:4.8.30-alt3
5.1: 4.8.11-alt0.M51.1
4.1: 4.6.2-alt7.pre1
4.0: 4.6.1r-alt9
3.0: 4.6.1r-alt3
www.altlinux.org/Changes

Группа :: Работа с файлами
Пакет: mc

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: mc-4.6.1-gentoo-invalid-mtime.patch
Скачать


  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, sizeof (timebuf) - 1, fmt, localtime(&when));
+    whentm = localtime(&when);
+    if (whentm == NULL)
+	return "(invalid)";
+
+    strftime (timebuf, sizeof (timebuf) - 1, fmt, whentm);
     return timebuf;
 }
 
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin