Skip to content

Commit

Permalink
* strftime.c (NEEDS): avoid SEGV due to integer overflow in sparc-sol…
Browse files Browse the repository at this point in the history
…aris2.10

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


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
ngoto committed Jul 30, 2011
1 parent 3761e00 commit cf310f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -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 17:26:26 2011 Masaki Suketa <masaki.suketa@nifty.ne.jp> Sat Jul 30 17:26:26 2011 Masaki Suketa <masaki.suketa@nifty.ne.jp>


* test/win32ole/test_win32ole_variant.rb: use skip method to skip the test. * test/win32ole/test_win32ole_variant.rb: use skip method to skip the test.
Expand Down
2 changes: 1 addition & 1 deletion strftime.c
Expand Up @@ -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))) \ if (precision > 0 || flags & (BIT_OF(LOCALE_E)|BIT_OF(LOCALE_O))) \
goto unknown; \ goto unknown; \
} while (0) } 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 { \ #define FILL_PADDING(i) do { \
if (!(flags & BIT_OF(LEFT)) && precision > (i)) { \ if (!(flags & BIT_OF(LEFT)) && precision > (i)) { \
NEEDS(precision); \ NEEDS(precision); \
Expand Down

0 comments on commit cf310f9

Please sign in to comment.