# HG changeset patch # User jwe # Date 1201030230 0 # Node ID 3257cccb9ed79a3471a8f841ba6ed0c6a3b0951a # Parent ca0cbc46abce4fe5dea13e0f1ca6541679aad500 [3-0-0-branch @ 2008-01-22 19:30:30 by jwe] diff -r ca0cbc46abce -r 3257cccb9ed7 liboctave/ChangeLog --- a/liboctave/ChangeLog Fri Jan 18 05:47:56 2008 +0000 +++ b/liboctave/ChangeLog Tue Jan 22 19:30:30 2008 +0000 @@ -1,3 +1,8 @@ +2008-01-22 Michael Goffioul + + * oct-time.cc (octave_base_tim::init): Validate pointer argument; + this fixes the "localtime(-1)" crash under Windows. + 2008-01-07 David Bateman * Sparse-op-defs.h (SPARSE_ANY_ALL_OP_ROW_CODE): Don't break from diff -r ca0cbc46abce -r 3257cccb9ed7 liboctave/oct-time.cc --- a/liboctave/oct-time.cc Fri Jan 18 05:47:56 2008 +0000 +++ b/liboctave/oct-time.cc Tue Jan 22 19:30:30 2008 +0000 @@ -291,6 +291,9 @@ void octave_base_tm::init (void *p) { + if (! p) + return; + struct tm *t = static_cast (p); tm_sec = t->tm_sec;