Merge branch 'master' into sccp
* master: (37 commits) #73594 tests only check the extra params if dns_get_record is successful Fixed bug #74852 (property_exists returns true on unknown DateInterval property) fix uninitialized var fix comparison warning comply with POSIX signature fix warning remove some casts cleanup casts remove useless cast eliminate casts sync vim mode lines in main [ci skip] update NEWS [ci skip] update NEWS [ci skip] update NEWS Fixed bug #74883 SQLite3::__construct() produces "out of memory" exception with invalid flags Silent compiler warning Fix test Deprecated the read_exif_data() alias Add myself as exif maintainer update libs versions ...
|
@ -269,7 +269,7 @@ STATUS: Working
|
|||
SINCE: 5.3
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: exif
|
||||
PRIMARY MAINTAINER: Marcus Boerger <helly@php.net>
|
||||
PRIMARY MAINTAINER: Kalle Sommer Nielsen <kalle@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.2
|
||||
|
|
21
NEWS
|
@ -9,6 +9,21 @@ PHP NEWS
|
|||
unserialize). (Nikita)
|
||||
. Fixed bug #74819 (wddx_deserialize() heap out-of-bound read via
|
||||
php_parse_date()). (Derick)
|
||||
. Fixed bug #74878 (Data race in ZTS builds). (Nikita)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #74852 (property_exists returns true on unknown DateInterval
|
||||
property). (jhdxr)
|
||||
|
||||
- EXIF:
|
||||
. Deprecated the read_exif_data() alias. (Kalle)
|
||||
. Fixed bug #74428 (exif_read_data(): "Illegal IFD size" warning occurs with
|
||||
correct exif format). (bradpiccho at gmail dot com, Kalle)
|
||||
. Fixed bug #72819 (EXIF thumbnails not read anymore). (Kalle)
|
||||
. Fixed bug #62523 (php crashes with segfault when exif_read_data called).
|
||||
(Kalle)
|
||||
. Fixed bug #50660 (exif_read_data(): Illegal IFD offset (works fine with
|
||||
other exif readers). (skinny dot bravo at gmail dot com, Kalle)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #74435 (Buffer over-read into uninitialized memory). (cmb)
|
||||
|
@ -25,6 +40,10 @@ PHP NEWS
|
|||
. Fixed bug #74873 (Minor BC break: PCRE_JIT changes output of preg_match()).
|
||||
(Dmitry)
|
||||
|
||||
- SQLite3:
|
||||
. Fixed bug #74883 (SQLite3::__construct() produces "out of memory" exception
|
||||
with invalid flags). (Anatol)
|
||||
|
||||
06 Jul 2017, PHP 7.2.0alpha3
|
||||
|
||||
- Core:
|
||||
|
@ -229,6 +248,8 @@ PHP NEWS
|
|||
. Fixed bug #73961 (environmental build dependency in hash sha3 source).
|
||||
(krakjoe)
|
||||
. Changed HashContext from resource to object. (Rouven Weßling, Sara)
|
||||
. Disallowed usage of non-cryptographic hash functions with HMAC and PBKDF2.
|
||||
(Andrey Andreev, Nikita)
|
||||
|
||||
- intl:
|
||||
. Fixed bug #74433 (wrong reflection for Normalizer methods). (villfa)
|
||||
|
|
|
@ -49,8 +49,8 @@ PHP 7.2 UPGRADE NOTES
|
|||
example `bcmod('4', '3.5')` now returns '0.5' instead of '1'.
|
||||
|
||||
- Hash:
|
||||
. The hash_hmac(), hash_hmac_file() and hash_pbkdf2() functions no longer
|
||||
accept non-cryptographic hashes.
|
||||
. The hash_hmac(), hash_hmac_file(), hash_pbkdf2() and hash_init() (with
|
||||
HASH_HMAC) functions no longer accept non-cryptographic hashes.
|
||||
|
||||
- JSON
|
||||
. The json_decode() option JSON_OBJECT_AS_ARRAY is used if the second
|
||||
|
@ -165,6 +165,9 @@ PHP 8.0.
|
|||
instead.
|
||||
. The each() function has been deprecated, use a foreach loop instead.
|
||||
|
||||
- EXIF:
|
||||
. The read_exif_data() alias have been deprecated, use exif_read_data() instead.
|
||||
|
||||
- GD:
|
||||
. png2wbmp() and jpeg2wbmp() have been deprecated.
|
||||
|
||||
|
|
|
@ -3742,6 +3742,10 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, z
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Must be interned to avoid ZTS data races */
|
||||
name = zend_new_interned_string(zend_string_copy(name));
|
||||
|
||||
if (access_type & ZEND_ACC_PUBLIC) {
|
||||
property_info->name = zend_string_copy(name);
|
||||
} else if (access_type & ZEND_ACC_PRIVATE) {
|
||||
|
|
|
@ -2016,7 +2016,7 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
|
|||
zval *prop;
|
||||
int retval = 0;
|
||||
|
||||
if (Z_TYPE_P(member) != IS_STRING) {
|
||||
if (UNEXPECTED(Z_TYPE_P(member) != IS_STRING)) {
|
||||
ZVAL_COPY(&tmp_member, member);
|
||||
convert_to_string(&tmp_member);
|
||||
member = &tmp_member;
|
||||
|
@ -2033,9 +2033,9 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
|
|||
return retval;
|
||||
}
|
||||
|
||||
prop = date_interval_read_property(object, member, type, cache_slot, &rv);
|
||||
prop = date_interval_read_property(object, member, BP_VAR_IS, cache_slot, &rv);
|
||||
|
||||
if (prop != NULL) {
|
||||
if (prop != &EG(uninitialized_zval)) {
|
||||
if (type == 2) {
|
||||
retval = 1;
|
||||
} else if (type == 1) {
|
||||
|
|
17
ext/date/tests/bug74852.phpt
Normal file
|
@ -0,0 +1,17 @@
|
|||
--TEST--
|
||||
Bug #74852 property_exists returns true on unknown DateInterval property
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$interval = new DateInterval('P2D');
|
||||
var_dump(property_exists($interval,'abcde'));
|
||||
var_dump(isset($interval->abcde));
|
||||
var_dump($interval->abcde);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Notice: Undefined property: DateInterval::$abcde in %s on line %d
|
||||
NULL
|
|
@ -120,7 +120,7 @@ ZEND_END_ARG_INFO()
|
|||
*/
|
||||
const zend_function_entry exif_functions[] = {
|
||||
PHP_FE(exif_read_data, arginfo_exif_read_data)
|
||||
PHP_FALIAS(read_exif_data, exif_read_data, arginfo_exif_read_data)
|
||||
PHP_DEP_FALIAS(read_exif_data, exif_read_data, arginfo_exif_read_data)
|
||||
PHP_FE(exif_tagname, arginfo_exif_tagname)
|
||||
PHP_FE(exif_thumbnail, arginfo_exif_thumbnail)
|
||||
PHP_FE(exif_imagetype, arginfo_exif_imagetype)
|
||||
|
@ -1340,8 +1340,10 @@ typedef enum mn_byte_order_t {
|
|||
|
||||
typedef enum mn_offset_mode_t {
|
||||
MN_OFFSET_NORMAL,
|
||||
MN_OFFSET_MAKER,
|
||||
MN_OFFSET_GUESS
|
||||
MN_OFFSET_MAKER
|
||||
#ifdef KALLE_0
|
||||
, MN_OFFSET_GUESS
|
||||
#endif
|
||||
} mn_offset_mode_t;
|
||||
|
||||
typedef struct {
|
||||
|
@ -1357,7 +1359,7 @@ typedef struct {
|
|||
|
||||
/* Remember to update PHP_MINFO if updated */
|
||||
static const maker_note_type maker_note_array[] = {
|
||||
{ tag_table_VND_CANON, "Canon", NULL, NULL, 0, 0, MN_ORDER_INTEL, MN_OFFSET_GUESS},
|
||||
{ tag_table_VND_CANON, "Canon", NULL, NULL, 0, 0, MN_ORDER_INTEL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_CASIO, "CASIO", NULL, NULL, 0, 0, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_FUJI, "FUJIFILM", NULL, "FUJIFILM\x0C\x00\x00\x00", 12, 12, MN_ORDER_INTEL, MN_OFFSET_MAKER},
|
||||
{ tag_table_VND_NIKON, "NIKON", NULL, "Nikon\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
|
@ -2677,7 +2679,7 @@ static void exif_process_SOFn (uchar *Data, int marker, jpeg_sof_info *result)
|
|||
/* }}} */
|
||||
|
||||
/* forward declarations */
|
||||
static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index);
|
||||
static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int tag);
|
||||
static int exif_process_IFD_TAG( image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table);
|
||||
|
||||
/* {{{ exif_get_markername
|
||||
|
@ -3118,7 +3120,10 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
|||
{
|
||||
size_t i;
|
||||
int de, section_index = SECTION_MAKERNOTE;
|
||||
int NumDirEntries, old_motorola_intel, offset_diff;
|
||||
int NumDirEntries, old_motorola_intel;
|
||||
#ifdef KALLE_0
|
||||
int offset_diff;
|
||||
#endif
|
||||
const maker_note_type *maker_note;
|
||||
char *dir_start;
|
||||
|
||||
|
@ -3176,6 +3181,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
|||
case MN_OFFSET_MAKER:
|
||||
offset_base = value_ptr;
|
||||
break;
|
||||
#ifdef KALLE_0
|
||||
case MN_OFFSET_GUESS:
|
||||
if (maker_note->offset + 10 + 4 >= value_len) {
|
||||
/* Can not read dir_start+10 since it's beyond value end */
|
||||
|
@ -3192,6 +3198,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
|||
}
|
||||
offset_base = value_ptr + offset_diff;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
case MN_OFFSET_NORMAL:
|
||||
break;
|
||||
|
@ -3524,7 +3531,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
|||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD Pointer");
|
||||
return FALSE;
|
||||
}
|
||||
if (!exif_process_IFD_in_JPEG(ImageInfo, Subdir_start, offset_base, IFDlength, displacement, sub_section_index)) {
|
||||
if (!exif_process_IFD_in_JPEG(ImageInfo, Subdir_start, offset_base, IFDlength, displacement, sub_section_index, tag)) {
|
||||
return FALSE;
|
||||
}
|
||||
#ifdef EXIF_DEBUG
|
||||
|
@ -3541,11 +3548,11 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
|||
|
||||
/* {{{ exif_process_IFD_in_JPEG
|
||||
* Process one of the nested IFDs directories. */
|
||||
static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index)
|
||||
static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int tag)
|
||||
{
|
||||
int de;
|
||||
int NumDirEntries;
|
||||
int NextDirOffset;
|
||||
int NextDirOffset = 0;
|
||||
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process %s (x%04X(=%d))", exif_get_sectionname(section_index), IFDlength, IFDlength);
|
||||
|
@ -3553,7 +3560,7 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
|
|||
|
||||
ImageInfo->sections_found |= FOUND_IFD0;
|
||||
|
||||
if ((dir_start + 2) >= (offset_base+IFDlength)) {
|
||||
if ((dir_start + 2) > (offset_base+IFDlength)) {
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size");
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -3581,11 +3588,15 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
|
|||
* Hack to make it process IDF1 I hope
|
||||
* There are 2 IDFs, the second one holds the keys (0x0201 and 0x0202) to the thumbnail
|
||||
*/
|
||||
if ((dir_start+2+12*de + 4) >= (offset_base+IFDlength)) {
|
||||
if ((dir_start+2+12*de + 4) > (offset_base+IFDlength)) {
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (tag != TAG_EXIF_IFD_POINTER && tag != TAG_GPS_IFD_POINTER) {
|
||||
NextDirOffset = php_ifd_get32u(dir_start+2+12*de, ImageInfo->motorola_intel);
|
||||
}
|
||||
|
||||
if (NextDirOffset) {
|
||||
/* the next line seems false but here IFDlength means length of all IFDs */
|
||||
if (offset_base + NextDirOffset < offset_base || offset_base + NextDirOffset > offset_base+IFDlength) {
|
||||
|
@ -3596,7 +3607,7 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
|
|||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Expect next IFD to be thumbnail");
|
||||
#endif
|
||||
if (exif_process_IFD_in_JPEG(ImageInfo, offset_base + NextDirOffset, offset_base, IFDlength, displacement, SECTION_THUMBNAIL)) {
|
||||
if (exif_process_IFD_in_JPEG(ImageInfo, offset_base + NextDirOffset, offset_base, IFDlength, displacement, SECTION_THUMBNAIL, 0)) {
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail size: 0x%04X", ImageInfo->Thumbnail.size);
|
||||
#endif
|
||||
|
@ -3651,7 +3662,7 @@ static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf,
|
|||
|
||||
ImageInfo->sections_found |= FOUND_IFD0;
|
||||
/* First directory starts at offset 8. Offsets starts at 0. */
|
||||
exif_process_IFD_in_JPEG(ImageInfo, CharBuf+offset_of_ifd, CharBuf, length/*-14*/, displacement, SECTION_IFD0);
|
||||
exif_process_IFD_in_JPEG(ImageInfo, CharBuf+offset_of_ifd, CharBuf, length/*-14*/, displacement, SECTION_IFD0, 0);
|
||||
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process TIFF in JPEG done");
|
||||
|
|
BIN
ext/exif/tests/bug50660/bug50660-1.jpg
Normal file
After Width: | Height: | Size: 860 KiB |
BIN
ext/exif/tests/bug50660/bug50660-2.jpg
Normal file
After Width: | Height: | Size: 917 KiB |
19
ext/exif/tests/bug50660/bug50660.phpt
Normal file
|
@ -0,0 +1,19 @@
|
|||
--TEST--
|
||||
Bug #50660 (exif_read_data(): Illegal IFD offset (works fine with other exif readers))
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--INI--
|
||||
output_handler=
|
||||
zlib.output_compression=0
|
||||
--FILE--
|
||||
<?php
|
||||
$infile = dirname(__FILE__).'/bug50660-1.jpg';
|
||||
var_dump(exif_read_data($infile) !== false);
|
||||
$infile = dirname(__FILE__).'/bug50660-2.jpg';
|
||||
var_dump(exif_read_data($infile) !== false);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
===DONE===
|
Before Width: | Height: | Size: 304 B After Width: | Height: | Size: 72 KiB |
|
@ -7,12 +7,10 @@ extension_loaded("exif") or die("skip need exif");
|
|||
--FILE--
|
||||
<?php
|
||||
echo "Test\n";
|
||||
var_dump(exif_read_data(__DIR__."/bug62523_1.jpg"));
|
||||
var_dump(count(exif_read_data(__DIR__."/bug62523_1.jpg")));
|
||||
?>
|
||||
Done
|
||||
--EXPECTF--
|
||||
--EXPECT--
|
||||
Test
|
||||
|
||||
Warning: exif_read_data(bug62523_1.jpg): File not supported in %sbug62523_1.php on line %d
|
||||
bool(false)
|
||||
int(86)
|
||||
Done
|
||||
|
|
|
@ -10,9 +10,7 @@ echo "Test\n";
|
|||
var_dump(count(exif_read_data(__DIR__."/bug62523_2.jpg")));
|
||||
?>
|
||||
Done
|
||||
--EXPECTF--
|
||||
--EXPECT--
|
||||
Test
|
||||
|
||||
Warning: exif_read_data(bug62523_2.jpg): IFD data bad offset: 0xADB23672 length 0x0D94 in %s%ebug62523_2.php on line %d
|
||||
int(30)
|
||||
int(76)
|
||||
Done
|
||||
|
|
BIN
ext/exif/tests/bug72819/bug72819.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
16
ext/exif/tests/bug72819/bug72819.phpt
Normal file
|
@ -0,0 +1,16 @@
|
|||
--TEST--
|
||||
Bug #72819 (EXIF thumbnails not read anymore)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--INI--
|
||||
output_handler=
|
||||
zlib.output_compression=0
|
||||
--FILE--
|
||||
<?php
|
||||
$infile = dirname(__FILE__).'/bug72819.jpg';
|
||||
var_dump(strlen(exif_thumbnail($infile)));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
int(5448)
|
||||
===DONE===
|
BIN
ext/exif/tests/bug73115/bug73115.JPG
Normal file
After Width: | Height: | Size: 4.7 MiB |
16
ext/exif/tests/bug73115/bug73115.phpt
Normal file
|
@ -0,0 +1,16 @@
|
|||
--TEST--
|
||||
Bug #73115 (exif_read_data triggers warning on reading binary strings)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--INI--
|
||||
output_handler=
|
||||
zlib.output_compression=0
|
||||
--FILE--
|
||||
<?php
|
||||
$infile = dirname(__FILE__).'/bug73115.JPG';
|
||||
var_dump(count(exif_read_data($infile)));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
int(80)
|
||||
===DONE===
|
BIN
ext/exif/tests/bug74428/bug74428.jpg
Normal file
After Width: | Height: | Size: 1.9 KiB |
50
ext/exif/tests/bug74428/bug74428.phpt
Normal file
|
@ -0,0 +1,50 @@
|
|||
--TEST--
|
||||
Bug #74428 (exif_read_data(): "Illegal IFD size" warning occurs with correct exif format)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--INI--
|
||||
output_handler=
|
||||
zlib.output_compression=0
|
||||
--FILE--
|
||||
<?php
|
||||
$infile = dirname(__FILE__).'/bug74428.jpg';
|
||||
var_dump(exif_read_data($infile));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
array(11) {
|
||||
["FileName"]=>
|
||||
string(12) "bug74428.jpg"
|
||||
["FileDateTime"]=>
|
||||
int(%d)
|
||||
["FileSize"]=>
|
||||
int(1902)
|
||||
["FileType"]=>
|
||||
int(2)
|
||||
["MimeType"]=>
|
||||
string(10) "image/jpeg"
|
||||
["SectionsFound"]=>
|
||||
string(19) "ANY_TAG, IFD0, EXIF"
|
||||
["COMPUTED"]=>
|
||||
array(5) {
|
||||
["html"]=>
|
||||
string(22) "width="88" height="28""
|
||||
["Height"]=>
|
||||
int(28)
|
||||
["Width"]=>
|
||||
int(88)
|
||||
["IsColor"]=>
|
||||
int(1)
|
||||
["ByteOrderMotorola"]=>
|
||||
int(0)
|
||||
}
|
||||
["Orientation"]=>
|
||||
int(1)
|
||||
["Exif_IFD_Pointer"]=>
|
||||
int(38)
|
||||
["ExifImageWidth"]=>
|
||||
int(88)
|
||||
["ExifImageLength"]=>
|
||||
int(28)
|
||||
}
|
||||
===DONE===
|
|
@ -19,6 +19,8 @@ print_r(read_exif_data(dirname(__FILE__).'/test2私はガラスを食べられ
|
|||
===Done===
|
||||
--EXPECTF--
|
||||
*** Testing read_exif_data() : basic functionality ***
|
||||
|
||||
Deprecated: Function read_exif_data() is deprecated in %sexif_read_exif_data_basic-mb.php on line 9
|
||||
Array
|
||||
(
|
||||
[FileName] => test2私はガラスを食べられます.jpg
|
||||
|
|
|
@ -19,6 +19,8 @@ print_r(read_exif_data(dirname(__FILE__).'/test2.jpg'));
|
|||
===Done===
|
||||
--EXPECTF--
|
||||
*** Testing read_exif_data() : basic functionality ***
|
||||
|
||||
Deprecated: Function read_exif_data() is deprecated in %sexif_read_exif_data_basic.php on line 9
|
||||
Array
|
||||
(
|
||||
[FileName] => test2.jpg
|
||||
|
|
|
@ -103,6 +103,7 @@ PHP_METHOD(sqlite3, open)
|
|||
char *filename, *encryption_key, *fullpath;
|
||||
size_t filename_len, encryption_key_len = 0;
|
||||
zend_long flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE;
|
||||
int rc;
|
||||
|
||||
db_obj = Z_SQLITE3_DB_P(object);
|
||||
|
||||
|
@ -133,11 +134,13 @@ PHP_METHOD(sqlite3, open)
|
|||
}
|
||||
|
||||
#if SQLITE_VERSION_NUMBER >= 3005000
|
||||
if (sqlite3_open_v2(fullpath, &(db_obj->db), flags, NULL) != SQLITE_OK) {
|
||||
rc = sqlite3_open_v2(fullpath, &(db_obj->db), flags, NULL);
|
||||
#else
|
||||
if (sqlite3_open(fullpath, &(db_obj->db)) != SQLITE_OK) {
|
||||
rc = sqlite3_open(fullpath, &(db_obj->db));
|
||||
#endif
|
||||
zend_throw_exception_ex(zend_ce_exception, 0, "Unable to open database: %s", sqlite3_errmsg(db_obj->db));
|
||||
if (rc != SQLITE_OK) {
|
||||
zend_throw_exception_ex(zend_ce_exception, 0, "Unable to open database: %s",
|
||||
db_obj->db ? sqlite3_errmsg(db_obj->db) : sqlite3_errstr(rc));
|
||||
if (fullpath != filename) {
|
||||
efree(fullpath);
|
||||
}
|
||||
|
|
|
@ -19,8 +19,9 @@ if (empty($out)) die("skip local resolver does not return additional records");
|
|||
<?php
|
||||
$auth = array();
|
||||
$additional = array();
|
||||
dns_get_record('php.net', DNS_MX, $auth, $additional);
|
||||
var_dump(empty($additional));
|
||||
$res = dns_get_record('php.net', DNS_MX, $auth, $additional);
|
||||
// only check $additional if dns_get_record is successful
|
||||
var_dump(!empty($res) && empty($additional));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
|
|
|
@ -18,8 +18,9 @@ if (empty($out)) die("skip local resolver does not return authority records");
|
|||
--FILE--
|
||||
<?php
|
||||
$auth = array();
|
||||
dns_get_record('php.net', DNS_MX, $auth);
|
||||
var_dump(empty($auth));
|
||||
$res = dns_get_record('php.net', DNS_MX, $auth);
|
||||
// only check $auth if dns_get_record is successful
|
||||
var_dump(!empty($res) && empty($auth));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
|
|
|
@ -646,7 +646,7 @@ static void sapi_header_add_op(sapi_header_op_enum op, sapi_header_struct *sapi_
|
|||
char sav = *colon_offset;
|
||||
|
||||
*colon_offset = 0;
|
||||
sapi_remove_header(&SG(sapi_headers).headers, sapi_header->header, (int)strlen(sapi_header->header));
|
||||
sapi_remove_header(&SG(sapi_headers).headers, sapi_header->header, strlen(sapi_header->header));
|
||||
*colon_offset = sav;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -327,4 +327,6 @@ END_EXTERN_C()
|
|||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -41,3 +41,11 @@ PHPAPI void php_explicit_bzero(void *dst, size_t siz)
|
|||
__explicit_bzero_hook(dst, siz);
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -140,8 +140,8 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path
|
|||
char local_open_basedir[MAXPATHLEN];
|
||||
char path_tmp[MAXPATHLEN];
|
||||
char *path_file;
|
||||
int resolved_basedir_len;
|
||||
int resolved_name_len;
|
||||
size_t resolved_basedir_len;
|
||||
size_t resolved_name_len;
|
||||
size_t path_len;
|
||||
int nesting_level = 0;
|
||||
|
||||
|
@ -214,9 +214,9 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path
|
|||
|
||||
/* Resolve open_basedir to resolved_basedir */
|
||||
if (expand_filepath(local_open_basedir, resolved_basedir) != NULL) {
|
||||
int basedir_len = (int)strlen(basedir);
|
||||
size_t basedir_len = strlen(basedir);
|
||||
/* Handler for basedirs that end with a / */
|
||||
resolved_basedir_len = (int)strlen(resolved_basedir);
|
||||
resolved_basedir_len = strlen(resolved_basedir);
|
||||
#ifdef PHP_WIN32
|
||||
if (basedir[basedir_len - 1] == PHP_DIR_SEPARATOR || basedir[basedir_len - 1] == '/') {
|
||||
#else
|
||||
|
@ -231,7 +231,7 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path
|
|||
resolved_basedir[resolved_basedir_len] = '\0';
|
||||
}
|
||||
|
||||
resolved_name_len = (int)strlen(resolved_name);
|
||||
resolved_name_len = strlen(resolved_name);
|
||||
if (path_tmp[path_len - 1] == PHP_DIR_SEPARATOR) {
|
||||
if (resolved_name[resolved_name_len - 1] != PHP_DIR_SEPARATOR) {
|
||||
resolved_name[resolved_name_len] = PHP_DIR_SEPARATOR;
|
||||
|
|
|
@ -54,4 +54,6 @@ END_EXTERN_C()
|
|||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -82,3 +82,11 @@ static http_response_status_code_pair http_status_map[] = {
|
|||
static const size_t http_status_map_len = (sizeof(http_status_map) / sizeof(http_response_status_code_pair)) - 1;
|
||||
|
||||
#endif /* HTTP_STATUS_CODES_H */
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -376,3 +376,11 @@
|
|||
#endif
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -29,3 +29,11 @@ int php_startup_sapi_content_types(void);
|
|||
int php_setup_sapi_content_types(void);
|
||||
|
||||
#endif /* PHP_CONTENT_TYPES_H */
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -176,4 +176,6 @@ struct _php_core_globals {
|
|||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -89,3 +89,11 @@ END_EXTERN_C()
|
|||
#define php_ini_string zend_ini_string
|
||||
|
||||
#endif /* PHP_INI_H */
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -56,3 +56,11 @@ extern int php_shutdown_environ(void);
|
|||
END_EXTERN_C()
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -344,7 +344,9 @@ END_EXTERN_C()
|
|||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 8
|
||||
* c-basic-offset: 8
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -114,7 +114,7 @@ static int php_do_open_temporary_file(const char *path, const char *pfx, zend_st
|
|||
}
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
if (!php_win32_check_trailing_space(pfx, (const int)strlen(pfx))) {
|
||||
if (!php_win32_check_trailing_space(pfx, strlen(pfx))) {
|
||||
SetLastError(ERROR_INVALID_NAME);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -32,3 +32,11 @@ PHPAPI const char *php_get_temporary_directory(void);
|
|||
END_EXTERN_C()
|
||||
|
||||
#endif /* PHP_OPEN_TEMPORARY_FILE_H */
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -131,3 +131,11 @@ void reentrancy_shutdown(void);
|
|||
#endif
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -52,3 +52,11 @@ PHPAPI int php_alphasort(const struct dirent **a, const struct dirent **b);
|
|||
#endif
|
||||
|
||||
#endif /* PHP_SCANDIR_H */
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -50,3 +50,11 @@
|
|||
#endif
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -38,4 +38,6 @@ END_EXTERN_C()
|
|||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -48,3 +48,11 @@ END_EXTERN_C()
|
|||
#define NUM_TRACK_VARS 6
|
||||
|
||||
#endif /* PHP_VARIABLES_H */
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -89,3 +89,11 @@ SAPI_API void php_rfc1867_set_multibyte_callbacks(
|
|||
php_rfc1867_basename_t basename);
|
||||
|
||||
#endif /* RFC1867_H */
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -178,4 +178,6 @@ PHPAPI char * ap_php_conv_p2(u_wide_int num, int nbits,
|
|||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -40,4 +40,6 @@ END_EXTERN_C()
|
|||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
|
|
@ -618,10 +618,10 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con
|
|||
php_stream *stream;
|
||||
php_stream_temp_data *ts;
|
||||
char *comma, *semi, *sep, *key;
|
||||
size_t mlen, dlen, plen, vlen;
|
||||
size_t mlen, dlen, plen, vlen, ilen;
|
||||
zend_off_t newoffs;
|
||||
zval meta;
|
||||
int base64 = 0, ilen;
|
||||
int base64 = 0;
|
||||
zend_string *base64_comma = NULL;
|
||||
|
||||
ZVAL_NULL(&meta);
|
||||
|
@ -720,11 +720,11 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con
|
|||
return NULL;
|
||||
}
|
||||
comma = ZSTR_VAL(base64_comma);
|
||||
ilen = (int)ZSTR_LEN(base64_comma);
|
||||
ilen = ZSTR_LEN(base64_comma);
|
||||
} else {
|
||||
comma = estrndup(comma, dlen);
|
||||
dlen = php_url_decode(comma, dlen);
|
||||
ilen = (int)dlen;
|
||||
ilen = dlen;
|
||||
}
|
||||
|
||||
if ((stream = php_stream_temp_create_rel(0, ~0u)) != NULL) {
|
||||
|
|
|
@ -1139,11 +1139,11 @@ static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_f
|
|||
}
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
if (!php_win32_check_trailing_space(url_from, (int)strlen(url_from))) {
|
||||
if (!php_win32_check_trailing_space(url_from, strlen(url_from))) {
|
||||
php_win32_docref2_from_error(ERROR_INVALID_NAME, url_from, url_to);
|
||||
return 0;
|
||||
}
|
||||
if (!php_win32_check_trailing_space(url_to, (int)strlen(url_to))) {
|
||||
if (!php_win32_check_trailing_space(url_to, strlen(url_to))) {
|
||||
php_win32_docref2_from_error(ERROR_INVALID_NAME, url_from, url_to);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1311,7 +1311,7 @@ static int php_plain_files_rmdir(php_stream_wrapper *wrapper, const char *url, i
|
|||
}
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
if (!php_win32_check_trailing_space(url, (int)strlen(url))) {
|
||||
if (!php_win32_check_trailing_space(url, strlen(url))) {
|
||||
php_error_docref1(NULL, url, E_WARNING, "%s", strerror(ENOENT));
|
||||
return 0;
|
||||
}
|
||||
|
@ -1337,12 +1337,9 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url
|
|||
#endif
|
||||
mode_t mode;
|
||||
int ret = 0;
|
||||
#ifdef PHP_WIN32
|
||||
int url_len = (int)strlen(url);
|
||||
#endif
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
if (!php_win32_check_trailing_space(url, url_len)) {
|
||||
if (!php_win32_check_trailing_space(url, strlen(url))) {
|
||||
php_error_docref1(NULL, url, E_WARNING, "%s", strerror(ENOENT));
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1691,7 +1691,7 @@ function ADD_SOURCES(dir, file_list, target, obj_dir)
|
|||
MFO.WriteLine("\t@$(CC) $(" + flags + ") $(CFLAGS) $(" + bd_flags_name + ") /c " + dir + "\\" + src + " /Fo" + sub_build + d + obj);
|
||||
|
||||
if ("clang" == PHP_ANALYZER) {
|
||||
MFO.WriteLine("\t\"@$(CLANG_CL)\" " + analyzer_base_args + " $(" + flags + "_ANALYZER) $(CFLAGS_ANALYZER) $(" + bd_flags_name + "_ANALYZER) " + dir + "\\" + src);
|
||||
MFO.WriteLine("\t@\"$(CLANG_CL)\" " + analyzer_base_args + " $(" + flags + "_ANALYZER) $(CFLAGS_ANALYZER) $(" + bd_flags_name + "_ANALYZER) " + dir + "\\" + src);
|
||||
} else if ("cppcheck" == PHP_ANALYZER) {
|
||||
MFO.WriteLine("\t\"@$(CPPCHECK)\" " + analyzer_base_args + " $(" + flags + "_ANALYZER) $(CFLAGS_ANALYZER) $(" + bd_flags_name + "_ANALYZER) " + analyzer_base_flags + " " + dir + "\\" + src);
|
||||
}else if (PHP_ANALYZER == "pvs") {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
bz2-1.0.6
|
||||
cclient-2007f
|
||||
freetype-2.7.0
|
||||
freetype-2.8.0
|
||||
icu-57.1
|
||||
jpeglib-9b
|
||||
libcurl-7.54.0
|
||||
libcurl-7.54.1
|
||||
libiconv-1.15
|
||||
libmpir-3.0.0
|
||||
libpng-1.6.29
|
||||
|
|
|
@ -395,14 +395,15 @@ PW32IO int php_win32_ioutil_rename_w(const wchar_t *oldname, const wchar_t *newn
|
|||
return ret;
|
||||
}/*}}}*/
|
||||
|
||||
PW32IO wchar_t *php_win32_ioutil_getcwd_w(const wchar_t *buf, int len)
|
||||
PW32IO wchar_t *php_win32_ioutil_getcwd_w(wchar_t *buf, size_t len)
|
||||
{/*{{{*/
|
||||
DWORD err = 0;
|
||||
wchar_t *tmp_buf = NULL;
|
||||
DWORD tmp_len = (DWORD)len;
|
||||
|
||||
/* If buf was NULL, the result has to be freed outside here. */
|
||||
if (!buf) {
|
||||
DWORD tmp_len = GetCurrentDirectoryW(0, NULL) + 1;
|
||||
tmp_len = GetCurrentDirectoryW(0, NULL) + 1;
|
||||
if (!tmp_len) {
|
||||
err = GetLastError();
|
||||
SET_ERRNO_FROM_WIN32_CODE(err);
|
||||
|
@ -412,9 +413,7 @@ PW32IO wchar_t *php_win32_ioutil_getcwd_w(const wchar_t *buf, int len)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
len = tmp_len;
|
||||
|
||||
tmp_buf = (wchar_t *)malloc((len)*sizeof(wchar_t));
|
||||
tmp_buf = (wchar_t *)malloc((tmp_len)*sizeof(wchar_t));
|
||||
if (!tmp_buf) {
|
||||
SET_ERRNO_FROM_WIN32_CODE(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return NULL;
|
||||
|
@ -422,7 +421,7 @@ PW32IO wchar_t *php_win32_ioutil_getcwd_w(const wchar_t *buf, int len)
|
|||
buf = tmp_buf;
|
||||
}
|
||||
|
||||
if (!GetCurrentDirectoryW(len, buf)) {
|
||||
if (!GetCurrentDirectoryW(tmp_len, buf)) {
|
||||
err = GetLastError();
|
||||
SET_ERRNO_FROM_WIN32_CODE(err);
|
||||
free(tmp_buf);
|
||||
|
@ -522,7 +521,7 @@ PW32IO php_win32_ioutil_normalization_result php_win32_ioutil_normalize_path_w(w
|
|||
return PHP_WIN32_IOUTIL_NORM_FAIL;
|
||||
}
|
||||
|
||||
while (NULL != (pos = wcschr(idx, PHP_WIN32_IOUTIL_FW_SLASHW)) && idx - *buf <= len) {
|
||||
while (NULL != (pos = wcschr(idx, PHP_WIN32_IOUTIL_FW_SLASHW)) && (size_t)(idx - *buf) <= len) {
|
||||
*pos = PHP_WIN32_IOUTIL_DEFAULT_SLASHW;
|
||||
idx = pos++;
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ typedef enum {
|
|||
#define PHP_WIN32_IOUTIL_CHECK_PATH_W(pathw, ret, dealloc) do { \
|
||||
if (!PHP_WIN32_IOUTIL_PATH_IS_OK_W(pathw, wcslen(pathw))) { \
|
||||
if (dealloc) { \
|
||||
free(pathw); \
|
||||
free((void *)pathw); \
|
||||
} \
|
||||
SET_ERRNO_FROM_WIN32_CODE(ERROR_ACCESS_DENIED); \
|
||||
return ret; \
|
||||
|
@ -222,7 +222,7 @@ PW32IO size_t php_win32_ioutil_dirname(char *buf, size_t len);
|
|||
PW32IO int php_win32_ioutil_open_w(const wchar_t *path, int flags, ...);
|
||||
PW32IO int php_win32_ioutil_chdir_w(const wchar_t *path);
|
||||
PW32IO int php_win32_ioutil_rename_w(const wchar_t *oldname, const wchar_t *newname);
|
||||
PW32IO wchar_t *php_win32_ioutil_getcwd_w(const wchar_t *buf, int len);
|
||||
PW32IO wchar_t *php_win32_ioutil_getcwd_w(wchar_t *buf, size_t len);
|
||||
|
||||
#if 0
|
||||
PW32IO int php_win32_ioutil_mkdir_w(const wchar_t *path, mode_t mode);
|
||||
|
|
|
@ -36,9 +36,9 @@ PHP_WINUTIL_API char *php_win32_error_to_msg(HRESULT error)
|
|||
return (buf ? (char *) buf : "");
|
||||
}/*}}}*/
|
||||
|
||||
int php_win32_check_trailing_space(const char * path, const int path_len)
|
||||
int php_win32_check_trailing_space(const char * path, const size_t path_len)
|
||||
{/*{{{*/
|
||||
if (path_len < 1) {
|
||||
if (path_len > MAXPATHLEN - 1) {
|
||||
return 1;
|
||||
}
|
||||
if (path) {
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
PHP_WINUTIL_API char *php_win32_error_to_msg(HRESULT error);
|
||||
|
||||
#define php_win_err() php_win32_error_to_msg(GetLastError())
|
||||
int php_win32_check_trailing_space(const char * path, const int path_len);
|
||||
int php_win32_check_trailing_space(const char * path, const size_t path_len);
|
||||
PHP_WINUTIL_API int php_win32_get_random_bytes(unsigned char *buf, size_t size);
|
||||
#ifdef PHP_EXPORTS
|
||||
BOOL php_win32_init_random_bytes(void);
|
||||
|
|