1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* strftime.c (NEEDS): avoid SEGV due to integer overflow in sparc-solaris2.10

and i686-linux.  fix [Bug #4456] [ruby-dev:43284]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ngoto 2011-07-30 13:41:45 +00:00
parent 086dd7508f
commit 875cea0266
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Sat Jul 30 22:35:50 2011 Naohisa Goto <ngotogenome@gmail.com>
* strftime.c (NEEDS): avoid SEGV due to integer overflow in
sparc-solaris2.10 and i686-linux. fix [Bug #4456] [ruby-dev:43284]
Sat Jul 30 14:27:00 2011 Kenta Murata <mrkn@mrkn.jp>
* backport r32754 from trunk.

View file

@ -210,7 +210,7 @@ rb_strftime_with_timespec(char *s, size_t maxsize, const char *format, const str
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); \