From d4a716b19dc3c150f7ffcfba7463f49aefec7c6e Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Sun, 7 Aug 2011 16:10:34 +0000 Subject: [PATCH] Fix more signed 1-bit bitfield, and let's use strlcpy/strlcat instead for these static string copies --- ext/phar/phar_internal.h | 6 +++--- ext/standard/php_crypt_r.c | 2 +- sapi/cli/php_cli_server.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index 59ff19fd97..dc40875fbc 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -485,9 +485,9 @@ typedef struct _phar_entry_data { 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; diff --git a/ext/standard/php_crypt_r.c b/ext/standard/php_crypt_r.c index f169c1a745..f4516712da 100644 --- a/ext/standard/php_crypt_r.c +++ b/ext/standard/php_crypt_r.c @@ -377,7 +377,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out) /* 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); diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index f11e1db03d..3202afe00d 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -160,13 +160,13 @@ typedef struct php_cli_server_client { 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; -- 2.40.0