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

* pack.c (pack_pack): do not call rb_str_buf_cat() with NULL ptr,

which causes SEGV; jump to grow instead. [ruby-dev:19944]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-03-29 11:17:55 +00:00
parent 7c9b9e39bd
commit 5bfef93c44
2 changed files with 13 additions and 4 deletions

View file

@ -1,3 +1,8 @@
Sat Mar 29 17:54:46 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* pack.c (pack_pack): do not call rb_str_buf_cat() with NULL ptr,
which causes SEGV; jump to grow instead. [ruby-dev:19944]
Sat Mar 29 15:19:48 2003 Tanaka Akira <akr@m17n.org> Sat Mar 29 15:19:48 2003 Tanaka Akira <akr@m17n.org>
* instruby.rb, ext/extmk.rb, lib/benchmark.rb, lib/cgi.rb, * instruby.rb, ext/extmk.rb, lib/benchmark.rb, lib/cgi.rb,

12
pack.c
View file

@ -489,7 +489,8 @@ pack_pack(ary, fmt)
c = byte & 0xff; c = byte & 0xff;
rb_str_buf_cat(res, &c, 1); rb_str_buf_cat(res, &c, 1);
} }
rb_str_buf_cat(res, 0, j); len = j;
goto grow;
} }
break; break;
@ -518,7 +519,8 @@ pack_pack(ary, fmt)
c = byte & 0xff; c = byte & 0xff;
rb_str_buf_cat(res, &c, 1); rb_str_buf_cat(res, &c, 1);
} }
rb_str_buf_cat(res, 0, j); len = j;
goto grow;
} }
break; break;
@ -548,7 +550,8 @@ pack_pack(ary, fmt)
char c = byte & 0xff; char c = byte & 0xff;
rb_str_buf_cat(res, &c, 1); rb_str_buf_cat(res, &c, 1);
} }
rb_str_buf_cat(res, 0, j); len = 1;
goto grow;
} }
break; break;
@ -578,7 +581,8 @@ pack_pack(ary, fmt)
char c = byte & 0xff; char c = byte & 0xff;
rb_str_buf_cat(res, &c, 1); rb_str_buf_cat(res, &c, 1);
} }
rb_str_buf_cat(res, 0, j); len = j;
goto grow;
} }
break; break;
} }