From f81ec94ac09ec39538a9b0b34a6893290c35b32e Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Mon, 13 May 2002 18:11:27 +0000 Subject: [PATCH] Make sure newtime is never NULL --- ext/standard/filestat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index d3d7abf658..77567a2b6a 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -478,17 +478,17 @@ PHP_FUNCTION(touch) struct utimbuf *newtime = NULL; int ac = ZEND_NUM_ARGS(); + newtime = &newtimebuf; + if (ac == 1 && zend_get_parameters_ex(1, &filename) != FAILURE) { #ifndef HAVE_UTIME_NULL newtime->modtime = newtime->actime = time(NULL); #endif } else if (ac == 2 && zend_get_parameters_ex(2, &filename, &filetime) != FAILURE) { - newtime = &newtimebuf; convert_to_long_ex(filetime); newtime->actime = time(NULL); newtime->modtime = newtime->actime = Z_LVAL_PP(filetime); } else if (ac == 3 && zend_get_parameters_ex(3, &filename, &filetime, &fileatime) != FAILURE) { - newtime = &newtimebuf; convert_to_long_ex(fileatime); convert_to_long_ex(filetime); newtime->actime = Z_LVAL_PP(fileatime); -- 2.50.1