[PHP-CVS] com php-src: Merge branch '5.4': ext/standard/pack.c

2012-04-23 Thread Gustavo André dos Santos Lopes
Commit:d77cde46e138b41c944807545489e82c4ac12b8d
Author:Gustavo André dos Santos Lopes  Mon, 23 
Apr 2012 22:10:50 +0100
Parents:   93d42fb444cbcd3850afd3db028319b8d4c30f10 
485638a09c23e48820e0160c26098b0ef571c533
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=d77cde46e138b41c944807545489e82c4ac12b8d

Log:
Merge branch '5.4'

Changed paths:
  MM  ext/standard/pack.c


Diff:



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Fixed bug #61764: 'I' unpacks n as signed if n > 2^31-1 on LP64: NEWS ext/standard/pack.c ext/standard/tests/strings/bug38770.phpt ext/standard/tests/strings/bug61764.phpt

2012-04-23 Thread Gustavo André dos Santos Lopes
Commit:8d748e5de519867d9b6ce40e3ea28a209b07768f
Author:Gustavo André dos Santos Lopes  Mon, 23 
Apr 2012 22:09:38 +0100
Parents:   c8865e3b84c9a3d08811b3b8f954defcd8fb621d
Branches:  PHP-5.3 PHP-5.4 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=8d748e5de519867d9b6ce40e3ea28a209b07768f

Log:
Fixed bug #61764: 'I' unpacks n as signed if n > 2^31-1 on LP64

Also fixed possible invalid read on big endian LP64.

Bugs:
https://bugs.php.net/61764

Changed paths:
  M  NEWS
  M  ext/standard/pack.c
  M  ext/standard/tests/strings/bug38770.phpt
  A  ext/standard/tests/strings/bug61764.phpt


Diff:
diff --git a/NEWS b/NEWS
index a483909..b8193c9 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ PHP 
   NEWS
 ?? ??? 2012, PHP 5.3.12
 
 - Core:
+  . Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
   . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
set to null). (Anatoliy)
 
diff --git a/ext/standard/pack.c b/ext/standard/pack.c
index 5ad1ecf..5d3c8a8 100644
--- a/ext/standard/pack.c
+++ b/ext/standard/pack.c
@@ -759,16 +759,14 @@ PHP_FUNCTION(unpack)
 
case 'i': 
case 'I': {
-   long v = 0;
+   long v;
int issigned = 0;
 
if (type == 'i') {
issigned = 
input[inputpos + (machine_little_endian ? (sizeof(int) - 1) : 0)] & 0x80;
-   } else if (sizeof(long) > 4 && 
(input[inputpos + machine_endian_long_map[3]] & 0x80) == 0x80) {
-   v = ~INT_MAX;
}
 
-   v |= 
php_unpack(&input[inputpos], sizeof(int), issigned, int_map);
+   v = 
php_unpack(&input[inputpos], sizeof(int), issigned, int_map);
add_assoc_long(return_value, n, 
v);
break;
}
diff --git a/ext/standard/tests/strings/bug38770.phpt 
b/ext/standard/tests/strings/bug38770.phpt
index 417794c..1821639 100644
--- a/ext/standard/tests/strings/bug38770.phpt
+++ b/ext/standard/tests/strings/bug38770.phpt
@@ -7,7 +7,7 @@ if (PHP_INT_SIZE != 8) die("skip this test is for 64bit 
platform only");
 --FILE--
  -3
 )
-Array
-(
-[1] => -3
-)
 Done
diff --git a/ext/standard/tests/strings/bug61764.phpt 
b/ext/standard/tests/strings/bug61764.phpt
new file mode 100644
index 000..dc44f25
--- /dev/null
+++ b/ext/standard/tests/strings/bug61764.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Bug #61764: 'I' unpacks n as signed if n > 2^31-1 on LP64
+--SKIPIF--
+ 4294937296
+)


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Merge branch '5.3' into 5.4: ext/standard/pack.c

2012-04-23 Thread Gustavo André dos Santos Lopes
Commit:485638a09c23e48820e0160c26098b0ef571c533
Author:Gustavo André dos Santos Lopes  Mon, 23 
Apr 2012 22:10:23 +0100
Parents:   883d40667d1e71b923aa05b7a4fffc8d98ab9b5e 
8d748e5de519867d9b6ce40e3ea28a209b07768f
Branches:  PHP-5.4 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=485638a09c23e48820e0160c26098b0ef571c533

Log:
Merge branch '5.3' into 5.4

Changed paths:
  MM  ext/standard/pack.c


Diff:



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: - Fixed bug #61829 (Memory leak when calling MessageFormatter's constructor twice): ext/intl/msgformat/msgformat.c

2012-04-23 Thread Felipe Pena
Commit:c8865e3b84c9a3d08811b3b8f954defcd8fb621d
Author:Felipe Pena  Mon, 23 Apr 2012 15:18:12 
-0300
Parents:   da1b5346017899d1f09c908eee2d166249160293
Branches:  PHP-5.3 PHP-5.4 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=c8865e3b84c9a3d08811b3b8f954defcd8fb621d

Log:
- Fixed bug #61829 (Memory leak when calling MessageFormatter's constructor 
twice)

Bugs:
https://bugs.php.net/61829

Changed paths:
  M  ext/intl/msgformat/msgformat.c


Diff:
diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c
index b31db9d..84f14de 100755
--- a/ext/intl/msgformat/msgformat.c
+++ b/ext/intl/msgformat/msgformat.c
@@ -68,6 +68,10 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
INTL_CTOR_CHECK_STATUS(mfo, "msgfmt_create: error converting 
pattern to quote-friendly format");
}
 
+   if ((mfo)->mf_data.orig_format) {
+   msgformat_data_free(&mfo->mf_data TSRMLS_CC);
+   }
+
(mfo)->mf_data.orig_format = estrndup(pattern, pattern_len);
(mfo)->mf_data.orig_format_len = pattern_len;


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php