--- embedaddon/php/ext/standard/pack.c 2012/02/21 23:48:02 1.1 +++ embedaddon/php/ext/standard/pack.c 2013/07/22 01:32:05 1.1.1.3 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2012 The PHP Group | + | Copyright (c) 1997-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -15,7 +15,7 @@ | Author: Chris Schneider | +----------------------------------------------------------------------+ */ -/* $Id: pack.c,v 1.1 2012/02/21 23:48:02 misho Exp $ */ +/* $Id: pack.c,v 1.1.1.3 2013/07/22 01:32:05 misho Exp $ */ #include "php.h" @@ -39,7 +39,6 @@ #include #endif #include "ext/standard/head.h" -#include "safe_mode.h" #include "php_string.h" #include "pack.h" #if HAVE_PWD_H @@ -759,16 +758,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; }