From 124fb22a13fafa3648e4e15b4f207c7096d8155e Mon Sep 17 00:00:00 2001
From: Xinchen Hui <laruence@php.net>
Date: Thu, 8 Jan 2015 16:09:02 +0800
Subject: [PATCH] Fixed bug #68739 #68740 #68741

---
 ext/curl/interface.c     | 1 +
 ext/ereg/regex/regcomp.c | 4 ++++
 ext/pgsql/pgsql.c        | 3 +++
 3 files changed, 8 insertions(+)

--- php5.orig/ext/ereg/regex/regcomp.c
+++ php5/ext/ereg/regex/regcomp.c
@@ -1284,6 +1284,10 @@ int c;
 	register int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT;
 	register unsigned uc = (unsigned char)c;
 
+	if (!g->setbits) {
+		return(0);
+	}
+
 	for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize)
 		if (col[uc] != 0)
 			return(1);
--- php5.orig/ext/pgsql/pgsql.c
+++ php5/ext/pgsql/pgsql.c
@@ -6502,6 +6502,9 @@ static inline void build_tablename(smart
 	/* schame.table should be "schame"."table" */
 	table_copy = estrdup(table);
 	token = php_strtok_r(table_copy, ".", &tmp);
+	if (token == NULL) {
+		token = table;
+	}
 	len = strlen(token);
 	if (_php_pgsql_detect_identifier_escape(token, len) == SUCCESS) {
 		smart_str_appendl(querystr, token, len);
