summaryrefslogtreecommitdiffstats
path: root/bug71798.patch
blob: 88c3a77814ce4166c98cbdf04b30ebb1d6ce6652 (plain)
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
Backported from 5.5 for 5.4 by Remi Collet

From 95433e8e339dbb6b5d5541473c1661db6ba2c451 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev <stas@php.net>
Date: Sun, 27 Mar 2016 14:22:19 -0700
Subject: [PATCH] Fix bug #71798 - Integer Overflow in php_raw_url_encode

---
 ext/standard/url.c | 2 +-
 main/php_version.h | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ext/standard/url.c b/ext/standard/url.c
index 2f56d31..27a216a 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -600,7 +600,7 @@ PHPAPI int php_url_decode(char *str, int len)
  */
 PHPAPI char *php_raw_url_encode(char const *s, int len, int *new_length)
 {
-	register int x, y;
+	register size_t x, y;
 	unsigned char *str;
 
 	str = (unsigned char *) safe_emalloc(3, len, 1);