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