Skip to content

Commit 37c18f5

Browse files
committed
Fix more signed 1-bit bitfield, and let's use strlcpy/strlcat instead for these
static string copies
1 parent 2449c41 commit 37c18f5

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
@@ -382,7 +382,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out)
382382
/* Now make the output string */
383383
memcpy(passwd, MD5_MAGIC, MD5_MAGIC_LEN);
384384
strlcpy(passwd + MD5_MAGIC_LEN, sp, sl + 1);
385-
strncat(passwd, "$", 1);
385+
strlcat(passwd, "$", 1);
386386

387387
PHP_MD5Final(final, &ctx);
388388

0 commit comments

Comments
 (0)