2067da
From 12fe4e90be7bfa2a763197079f68f5568a14e071 Mon Sep 17 00:00:00 2001
2067da
From: Remi Collet <remi@php.net>
2067da
Date: Wed, 27 Nov 2013 11:13:16 +0100
2067da
Subject: [PATCH] Fixed bug #66060 (Heap buffer over-read in DateInterval)
2067da
2067da
---
2067da
 NEWS                                | 3 +++
2067da
 ext/date/lib/parse_iso_intervals.c  | 4 ++--
2067da
 ext/date/lib/parse_iso_intervals.re | 2 +-
2067da
 3 files changed, 6 insertions(+), 3 deletions(-)
2067da
2067da
diff --git a/ext/date/lib/parse_iso_intervals.c b/ext/date/lib/parse_iso_intervals.c
2067da
index bd1ad05..480ea38 100644
2067da
--- a/ext/date/lib/parse_iso_intervals.c
2067da
+++ b/ext/date/lib/parse_iso_intervals.c
2067da
@@ -415,7 +415,7 @@ yy6:
2067da
 					break;
2067da
 			}
2067da
 			ptr++;
2067da
-		} while (*ptr);
2067da
+		} while (!s->errors->error_count && *ptr);
2067da
 		s->have_period = 1;
2067da
 		TIMELIB_DEINIT;
2067da
 		return TIMELIB_PERIOD;
2067da
diff --git a/ext/date/lib/parse_iso_intervals.re b/ext/date/lib/parse_iso_intervals.re
2067da
index 56aa34d..c5e9f67 100644
2067da
--- a/ext/date/lib/parse_iso_intervals.re
2067da
+++ b/ext/date/lib/parse_iso_intervals.re
2067da
@@ -383,7 +383,7 @@ isoweek          = year4 "-"? "W" weekofyear;
2067da
 					break;
2067da
 			}
2067da
 			ptr++;
2067da
-		} while (*ptr);
2067da
+		} while (!s->errors->error_count && *ptr);
2067da
 		s->have_period = 1;
2067da
 		TIMELIB_DEINIT;
2067da
 		return TIMELIB_PERIOD;
2067da
-- 
2067da
1.8.4.3
2067da