]> granicus.if.org Git - php/commitdiff
Fix more signed 1-bit bitfield, and let's use strlcpy/strlcat instead for these
authorRasmus Lerdorf <rasmus@php.net>
Sun, 7 Aug 2011 16:10:34 +0000 (16:10 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Sun, 7 Aug 2011 16:10:34 +0000 (16:10 +0000)
static string copies

ext/phar/phar_internal.h
ext/standard/php_crypt_r.c
sapi/cli/php_cli_server.c

index 59ff19fd97261df8ef0762b130ae10c38933138d..dc40875fbc4f13d94af37fa4e7196cd3f3ea8781 100644 (file)
@@ -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;
 
index f169c1a745e84830287831f094773eeb923a7536..f4516712dae0679058040e227d866351b798387b 100644 (file)
@@ -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);
 
index f11e1db03dec12fc6908b363569250fdbfad2971..3202afe00d943cfb29c354ea4e523eee2e183ba3 100644 (file)
@@ -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;