Skip to content

Commit

Permalink
Fix more signed 1-bit bitfield, and let's use strlcpy/strlcat instead…
Browse files Browse the repository at this point in the history
… for these

static string copies
  • Loading branch information
rlerdorf committed Aug 7, 2011
1 parent 2449c41 commit 37c18f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/pdo/php_pdo_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/php_crypt_r.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 37c18f5

Please sign in to comment.