diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-29 11:17:55 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-29 11:17:55 +0000 |
| commit | 01f4a5877d720e4ad101f756e13bc9304a9d58af (patch) | |
| tree | 0893f3fa58c0b7c9b4decdf1a25fd356db2cb98a /pack.c | |
| parent | 43a1237df0e8063517bc7527a34fb6ef982ef4d4 (diff) | |
| download | ruby-01f4a5877d720e4ad101f756e13bc9304a9d58af.tar.gz ruby-01f4a5877d720e4ad101f756e13bc9304a9d58af.tar.xz ruby-01f4a5877d720e4ad101f756e13bc9304a9d58af.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@3636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
| -rw-r--r-- | pack.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -489,7 +489,8 @@ pack_pack(ary, fmt) c = byte & 0xff; rb_str_buf_cat(res, &c, 1); } - rb_str_buf_cat(res, 0, j); + len = j; + goto grow; } break; @@ -518,7 +519,8 @@ pack_pack(ary, fmt) c = byte & 0xff; rb_str_buf_cat(res, &c, 1); } - rb_str_buf_cat(res, 0, j); + len = j; + goto grow; } break; @@ -548,7 +550,8 @@ pack_pack(ary, fmt) char c = byte & 0xff; rb_str_buf_cat(res, &c, 1); } - rb_str_buf_cat(res, 0, j); + len = 1; + goto grow; } break; @@ -578,7 +581,8 @@ pack_pack(ary, fmt) char c = byte & 0xff; rb_str_buf_cat(res, &c, 1); } - rb_str_buf_cat(res, 0, j); + len = j; + goto grow; } break; } |
