~ubuntu-branches/ubuntu/gutsy/php5/gutsy

« back to all changes in this revision

Viewing changes to ext/sqlite/libsqlite/src/date.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt, CVE-2007-0905, CVE-2007-0906, CVE-2007-0909, CVE-2007-0910
  • Date: 2007-02-20 17:54:46 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070220175446-nudqyuv0dfowel3r
Tags: 5.2.1-0ubuntu1
* New upstream security/bugfix release:
  - safe_mode & open_basedir bypasses inside the session extension
    [CVE-2007-0905]
  - multiple buffer overflows in various extensions and functions
    [CVE-2007-0906]
  - underflow in the internal sapi_header_op() function [CVE-2007-0907]
  - information disclosure in the wddx extension [CVE-2007-0908]
  - string format vulnerability in *print() functions on 64 bit systems
    [CVE-2007-0909]
  - possible clobbering of super-globals in several code paths
    [CVE-2007-0910]
* Adapted patches to new upstream release:
  - 006-debian_quirks.patch
  - 034-apache2_umask_fix.patch
  - 044-strtod_arm_fix.patch
* Drop 109-libdb4.4.patch: Obsolete, upstream now checks for db 4.5 and 4.4.
* Drop 114-zend_alloc.c_m68k_alignment.patch and
  115-zend_alloc.c_memleak.patch: Applied upstream.
* Add debian/patches/000upstream-str_ireplace_offbyone.patch:
  - Fix off-by-one in str_ireplace(), a regression introduced in 5.2.1.
  - Patch taken from upstream CVS:
    http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.630&r2=1.631
  - CVE-2007-0911
* debian/control: Set Ubuntu maintainer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
** sqliteRegisterDateTimeFunctions() found at the bottom of the file.
17
17
** All other code has file scope.
18
18
**
19
 
** $Id: date.c,v 1.3.4.1 2005/09/07 15:11:32 iliaa Exp $
 
19
** $Id: date.c,v 1.3.4.1.2.2 2006/12/01 20:24:58 fmk Exp $
20
20
**
21
21
** NOTES:
22
22
**
53
53
#include <stdlib.h>
54
54
#include <assert.h>
55
55
#include <time.h>
 
56
#ifndef PHP_WIN32
 
57
#include "main/php_reentrancy.h"
 
58
#endif
56
59
 
57
60
#ifndef SQLITE_OMIT_DATETIME_FUNCS
58
61
 
397
400
static double localtimeOffset(DateTime *p){
398
401
  DateTime x, y;
399
402
  time_t t;
400
 
  struct tm *pTm;
 
403
  struct tm *pTm, tmbuf;
401
404
  x = *p;
402
405
  computeYMD_HMS(&x);
403
406
  if( x.Y<1971 || x.Y>=2038 ){
416
419
  computeJD(&x);
417
420
  t = (x.rJD-2440587.5)*86400.0 + 0.5;
418
421
  sqliteOsEnterMutex();
419
 
  pTm = localtime(&t);
 
422
  pTm = php_localtime_r(&t, &tmbuf);
420
423
  y.Y = pTm->tm_year + 1900;
421
424
  y.M = pTm->tm_mon + 1;
422
425
  y.D = pTm->tm_mday;