changeset 11618:3257cccb9ed7 release-3-0-x

[3-0-0-branch @ 2008-01-22 19:30:30 by jwe]
author jwe
date Tue, 22 Jan 2008 19:30:30 +0000
parents ca0cbc46abce
children f86f97948da6
files liboctave/ChangeLog liboctave/oct-time.cc
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/ChangeLog
+++ b/liboctave/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-22  Michael Goffioul <michael.goffioul@gmail.com>
+
+	* oct-time.cc (octave_base_tim::init): Validate pointer argument;
+	this fixes the "localtime(-1)" crash under Windows.
+
 2008-01-07  David Bateman  <dbateman@free.fr>
 
 	* Sparse-op-defs.h (SPARSE_ANY_ALL_OP_ROW_CODE): Don't break from
--- a/liboctave/oct-time.cc
+++ b/liboctave/oct-time.cc
@@ -291,6 +291,9 @@
 void
 octave_base_tm::init (void *p)
 {
+  if (! p)
+    return;
+
   struct tm *t = static_cast<struct tm*> (p);
   
   tm_sec = t->tm_sec;