Skip to content

Commit 7eb5bbb

Browse files
committed
Fix more signed 1-bit bitfield, and let's use strlcpy/strlcat instead for these
static string copies
1 parent d9845c2 commit 7eb5bbb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/pdo/php_pdo_int.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ extern pdo_driver_t *pdo_find_driver(const char *name, int namelen);
5858
extern void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC);
5959

6060
#define PDO_DBH_CLEAR_ERR() do { \
61-
strncpy(dbh->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \
61+
strlcpy(dbh->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \
6262
if (dbh->query_stmt) { \
6363
dbh->query_stmt = NULL; \
6464
zend_objects_store_del_ref(&dbh->query_stmt_zval TSRMLS_CC); \

ext/standard/php_crypt_r.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out)
377377
/* Now make the output string */
378378
memcpy(passwd, MD5_MAGIC, MD5_MAGIC_LEN);
379379
strlcpy(passwd + MD5_MAGIC_LEN, sp, sl + 1);
380-
strncat(passwd, "$", 1);
380+
strlcat(passwd, "$", 1);
381381

382382
PHP_MD5Final(final, &ctx);
383383

0 commit comments

Comments
 (0)