File: CVE-2015-1352.patch

package info (click to toggle)
php5 5.6.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 150,376 kB
  • sloc: ansic: 727,510; php: 21,966; sh: 12,356; cpp: 8,763; xml: 6,105; yacc: 1,551; exp: 1,514; makefile: 1,461; pascal: 1,048; awk: 538; perl: 315; sql: 22
file content (36 lines) | stat: -rw-r--r-- 1,115 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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);