summaryrefslogtreecommitdiff
path: root/ext/pgsql
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2016-11-05 13:59:35 -0700
committerStanislav Malyshev <stas@php.net>2016-11-05 13:59:35 -0700
commitf7f8aae33cdaf74ca2d360ccf24256d6afd99b39 (patch)
tree482f035296f161367dfdf769f1520364716d5118 /ext/pgsql
parent86ae78d7c67cf9b43dbee0033557058e5901047f (diff)
parent669763d88a8bb9707a45f0937a129b63a161d2f0 (diff)
downloadphp-git-f7f8aae33cdaf74ca2d360ccf24256d6afd99b39.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: More int->size_t and string overflow fixes
Diffstat (limited to 'ext/pgsql')
-rw-r--r--ext/pgsql/pgsql.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 1aa3855af0..43b32fd2ad 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -1543,7 +1543,7 @@ PHP_FUNCTION(pg_connect_poll)
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pgsql_link) == FAILURE) {
return;
}
-
+
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
}
@@ -4395,7 +4395,7 @@ PHP_FUNCTION(pg_escape_string)
break;
}
- to = zend_string_alloc(ZSTR_LEN(from) * 2, 0);
+ to = zend_string_safe_alloc(ZSTR_LEN(from), 2, 0, 0);
#ifdef HAVE_PQESCAPE_CONN
if (link) {
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
@@ -4447,7 +4447,7 @@ PHP_FUNCTION(pg_escape_bytea)
RETURN_FALSE;
}
to = (char *)PQescapeByteaConn(pgsql, (unsigned char *)from, (size_t)from_len, &to_len);
- } else
+ } else
#endif
to = (char *)PQescapeBytea((unsigned char*)from, from_len, &to_len);