]> 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/pdo/php_pdo_int.h
ext/standard/php_crypt_r.c

index 62b3bb9188489e6a3b68904c6b6d1a36847ebea6..774cd76f1402e1ef3bc8edbdd907512e4c83ee78 100755 (executable)
@@ -58,7 +58,7 @@ extern pdo_driver_t *pdo_find_driver(const char *name, int namelen);
 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); \
index e0d72448c2fa97d352071ca2cd8cdd7b18cb777c..ef711b81e4ffb258468365da404618ad15363e18 100644 (file)
@@ -382,7 +382,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);