From f99bed93302a0485b615dd651915d1262c1d1bcb Mon Sep 17 00:00:00 2001 From: tadf Date: Sat, 23 Jul 2011 11:17:00 +0000 Subject: * ext/date/date_core.c: an issue that is same as [ruby-dev:44071]. * ext/date/date_strftime.c: identical to [ruby-dev:44112]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/date/date_strftime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/date/date_strftime.c') diff --git a/ext/date/date_strftime.c b/ext/date/date_strftime.c index 02ad9a47ae..71e1bd7f00 100644 --- a/ext/date/date_strftime.c +++ b/ext/date/date_strftime.c @@ -212,7 +212,7 @@ date_strftime_with_tmx(char *s, size_t maxsize, const char *format, if (precision > 0 || flags & (BIT_OF(LOCALE_E)|BIT_OF(LOCALE_O))) \ goto unknown; \ } while (0) -#define NEEDS(n) do if (s + (n) >= endp - 1) goto err; while (0) +#define NEEDS(n) do if (s >= endp || (n) >= endp - s - 1) goto err; while (0) #define FILL_PADDING(i) do { \ if (!(flags & BIT_OF(LEFT)) && precision > (i)) { \ NEEDS(precision); \ -- cgit v1.2.3