changeset 7407:8433bb7865bd

[project @ 2008-01-22 19:29:51 by jwe]
author jwe
date Tue, 22 Jan 2008 19:29:51 +0000
parents e9b2e44f9341
children 246f905cb984
files liboctave/ChangeLog liboctave/oct-time.cc
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/ChangeLog	Sat Jan 19 07:42:15 2008 +0000
+++ b/liboctave/ChangeLog	Tue Jan 22 19:29:51 2008 +0000
@@ -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-18  John W. Eaton  <jwe@octave.org>
 
 	* dMatrix.cc (solve_singularity_warning): New function.
--- a/liboctave/oct-time.cc	Sat Jan 19 07:42:15 2008 +0000
+++ b/liboctave/oct-time.cc	Tue Jan 22 19:29:51 2008 +0000
@@ -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;