Skip to content

Commit 723ffe2

Browse files
committed
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: Bacport fix bug #68741 - Null pointer dereference Check that the type is correct
2 parents 0c27a8e + 968fbc6 commit 723ffe2

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ PHP NEWS
3333
- OpenSSL:
3434
. Fixed bug #67403 (Add signatureType to openssl_x509_parse).
3535

36+
- Postgres:
37+
. Fixed bug #68741 (Null pointer deference) (CVE-2015-1352). (Xinchen Hui)
38+
3639
- SPL:
3740
. Fixed bug #69227 (Use after free in zval_scan caused by
3841
spl_object_storage_get_gc). (adam dot scarr at 99designs dot com)

ext/pgsql/pgsql.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6136,6 +6136,9 @@ static inline void build_tablename(smart_str *querystr, PGconn *pg_link, const c
61366136
/* schame.table should be "schame"."table" */
61376137
table_copy = estrdup(table);
61386138
token = php_strtok_r(table_copy, ".", &tmp);
6139+
if (token == NULL) {
6140+
token = table;
6141+
}
61396142
len = strlen(token);
61406143
if (_php_pgsql_detect_identifier_escape(token, len) == SUCCESS) {
61416144
smart_str_appendl(querystr, token, len);

ext/standard/incomplete_class.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ PHPAPI char *php_lookup_class_name(zval *object, zend_uint *nlen)
144144

145145
object_properties = Z_OBJPROP_P(object);
146146

147-
if (zend_hash_find(object_properties, MAGIC_MEMBER, sizeof(MAGIC_MEMBER), (void **) &val) == SUCCESS) {
147+
if (zend_hash_find(object_properties, MAGIC_MEMBER, sizeof(MAGIC_MEMBER), (void **) &val) == SUCCESS && Z_TYPE_PP(val) == IS_STRING) {
148148
retval = estrndup(Z_STRVAL_PP(val), Z_STRLEN_PP(val));
149149

150150
if (nlen) {

0 commit comments

Comments
 (0)