rasmus Sun, 07 Aug 2011 16:10:34 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=314438
Log:
Fix more signed 1-bit bitfield, and let's use strlcpy/strlcat instead for these
static string copies
Changed paths:
U php/php-src/branches/PHP_5_3/ext/pdo/php_pdo_int.h
U php/php-src/branches/PHP_5_3/ext/standard/php_crypt_r.c
U php/php-src/branches/PHP_5_4/ext/phar/phar_internal.h
U php/php-src/branches/PHP_5_4/ext/standard/php_crypt_r.c
U php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
U php/php-src/trunk/ext/pdo/php_pdo_int.h
U php/php-src/trunk/ext/standard/php_crypt_r.c
Modified: php/php-src/branches/PHP_5_3/ext/pdo/php_pdo_int.h
===================================================================
--- php/php-src/branches/PHP_5_3/ext/pdo/php_pdo_int.h 2011-08-07 15:57:35 UTC
(rev 314437)
+++ php/php-src/branches/PHP_5_3/ext/pdo/php_pdo_int.h 2011-08-07 16:10:34 UTC
(rev 314438)
@@ -58,7 +58,7 @@
extern void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC);
#define PDO_DBH_CLEAR_ERR() do { \
- strncpy(dbh->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \
+ strlcpy(dbh->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \
if (dbh->query_stmt) { \
dbh->query_stmt = NULL; \
zend_objects_store_del_ref(&dbh->query_stmt_zval TSRMLS_CC); \
Modified: php/php-src/branches/PHP_5_3/ext/standard/php_crypt_r.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/php_crypt_r.c 2011-08-07
15:57:35 UTC (rev 314437)
+++ php/php-src/branches/PHP_5_3/ext/standard/php_crypt_r.c 2011-08-07
16:10:34 UTC (rev 314438)
@@ -382,7 +382,7 @@
/* Now make the output string */
memcpy(passwd, MD5_MAGIC, MD5_MAGIC_LEN);
strlcpy(passwd + MD5_MAGIC_LEN, sp, sl + 1);
- strncat(passwd, "$", 1);
+ strlcat(passwd, "$", 1);
PHP_MD5Final(final, &ctx);
Modified: php/php-src/branches/PHP_5_4/ext/phar/phar_internal.h
===================================================================
--- php/php-src/branches/PHP_5_4/ext/phar/phar_internal.h 2011-08-07
15:57:35 UTC (rev 314437)
+++ php/php-src/branches/PHP_5_4/ext/phar/phar_internal.h 2011-08-07
16:10:34 UTC (rev 314438)
@@ -485,9 +485,9 @@
off_t position;
/* for copies of the phar fp, defines where 0 is */
off_t zero;
- int for_write:1;
- int is_zip:1;
- int is_tar:1;
+ unsigned int for_write:1;
+ unsigned int is_zip:1;
+ unsigned int is_tar:1;
phar_entry_info *internal_file;
} phar_entry_data;
Modified: php/php-src/branches/PHP_5_4/ext/standard/php_crypt_r.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/standard/php_crypt_r.c 2011-08-07
15:57:35 UTC (rev 314437)
+++ php/php-src/branches/PHP_5_4/ext/standard/php_crypt_r.c 2011-08-07
16:10:34 UTC (rev 314438)
@@ -377,7 +377,7 @@
/* Now make the output string */
memcpy(passwd, MD5_MAGIC, MD5_MAGIC_LEN);
strlcpy(passwd + MD5_MAGIC_LEN, sp, sl + 1);
- strncat(passwd, "$", 1);
+ strlcat(passwd, "$", 1);
PHP_MD5Final(final, &ctx);
Modified: php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
===================================================================
--- php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c 2011-08-07
15:57:35 UTC (rev 314437)
+++ php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c 2011-08-07
16:10:34 UTC (rev 314438)
@@ -160,13 +160,13 @@
char *addr_str;
size_t addr_str_len;
php_http_parser parser;
- int request_read:1;
+ unsigned int request_read:1;
char *current_header_name;
size_t current_header_name_len;
- int current_header_name_allocated:1;
+ unsigned int current_header_name_allocated:1;
size_t post_read_offset;
php_cli_server_request request;
- int content_sender_initialized:1;
+ unsigned int content_sender_initialized:1;
php_cli_server_content_sender content_sender;
php_cli_server_buffer capture_buffer;
unsigned int capturing:1;
Modified: php/php-src/trunk/ext/pdo/php_pdo_int.h
===================================================================
--- php/php-src/trunk/ext/pdo/php_pdo_int.h 2011-08-07 15:57:35 UTC (rev
314437)
+++ php/php-src/trunk/ext/pdo/php_pdo_int.h 2011-08-07 16:10:34 UTC (rev
314438)
@@ -58,7 +58,7 @@
extern void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC);
#define PDO_DBH_CLEAR_ERR() do { \
- strncpy(dbh->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \
+ strlcpy(dbh->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \
if (dbh->query_stmt) { \
dbh->query_stmt = NULL; \
zend_objects_store_del_ref(&dbh->query_stmt_zval TSRMLS_CC); \
Modified: php/php-src/trunk/ext/standard/php_crypt_r.c
===================================================================
--- php/php-src/trunk/ext/standard/php_crypt_r.c 2011-08-07 15:57:35 UTC
(rev 314437)
+++ php/php-src/trunk/ext/standard/php_crypt_r.c 2011-08-07 16:10:34 UTC
(rev 314438)
@@ -377,7 +377,7 @@
/* Now make the output string */
memcpy(passwd, MD5_MAGIC, MD5_MAGIC_LEN);
strlcpy(passwd + MD5_MAGIC_LEN, sp, sl + 1);
- strncat(passwd, "$", 1);
+ strlcat(passwd, "$", 1);
PHP_MD5Final(final, &ctx);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php