summaryrefslogtreecommitdiff
path: root/strftime.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-07 08:44:45 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-07 08:44:45 +0000
commit1df42597d15416357a20bd68700ce1a2d245e8bb (patch)
treef588f28559958e27464866d7b137955bfff04a6f /strftime.c
parentfc634cc092f486adfc911f614b7b4aa2c48c698d (diff)
cancel subversion backfire. sorry
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'strftime.c')
-rw-r--r--strftime.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/strftime.c b/strftime.c
index dc6df615d7..9d9f48d0de 100644
--- a/strftime.c
+++ b/strftime.c
@@ -237,6 +237,10 @@ rb_strftime_with_timespec(char *s, size_t maxsize, const char *format, const str
i = rb_strftime_with_timespec(s, endp - s, (fmt), vtm, timev, ts, gmt); \
if (!i) return 0; \
if (precision > i) {\
+ if (start + maxsize < s + precision) { \
+ errno = ERANGE; \
+ return 0; \
+ } \
memmove(s + precision - i, s, i);\
memset(s, padding ? padding : ' ', precision - i); \
s += precision; \