Project

General

Profile

Actions

Bug #10019

closed

segmentation fault/buffer overrun in pack.c (encodes)

Added by wkwood (Will Wood) over 10 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.1.2p168 (2014-07-06 revision 46721) [i386-mingw32]
[ruby-core:63604]

Description

While working with an AWS sample I hit a segmentation fault. The same sample works under 1.9.3. It appeared to be coming from pack.c function encodes. After looking at the source there's a 4K buffer allocated on the stack. I made a minor change to base the buffer length off of the incoming buffer length with a pad and allocate it off the heap. Anyway, after fixing this my code sample runs fine. I'm including a patch file and the sample code.


Files

pack.patch (2.74 KB) pack.patch wkwood (Will Wood), 07/09/2014 02:35 PM
BucketTest.rb (326 Bytes) BucketTest.rb wkwood (Will Wood), 07/09/2014 02:38 PM
pack.c.patch (769 Bytes) pack.c.patch wkwood (Will Wood), 07/28/2014 02:47 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0