aboutsummaryrefslogtreecommitdiffstats
path: root/ext/date/date_strftime.c
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-23 11:17:00 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-23 11:17:00 +0000
commitf99bed93302a0485b615dd651915d1262c1d1bcb (patch)
tree8bf4e6e1b6d7b72ea51ad03017eaccb268682bf4 /ext/date/date_strftime.c
parente845e35fa31766f347abdb86bf69793d584537fc (diff)
downloadruby-f99bed93302a0485b615dd651915d1262c1d1bcb.tar.gz
* 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
Diffstat (limited to 'ext/date/date_strftime.c')
-rw-r--r--ext/date/date_strftime.c2
1 files changed, 1 insertions, 1 deletions
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); \