Project

General

Profile

Actions

Bug #10568

closed

segmentation fault after pack & ioctl & unpack

Added by bkutil (Balazs Kutil) about 10 years ago. Updated over 9 years ago.

Status:
Closed
Target version:
-
[ruby-core:66688]

Description

This snippet produces a segmentation fault on rubies on ruby_2_1 branch from git commit [1]
onwards and ruby_2_0_0 branch from commit [2] onwards. I was unable to reproduce the issue
on the current trunk [3]:

require 'socket'
SIOCETHTOOL = 0x8946
i = ["lo", "\n"].pack("a16p")
s = Socket.new(Socket::AF_INET, Socket::SOCK_DGRAM, 0)
s.ioctl(SIOCETHTOOL, i)
i.unpack("a16p")[1]

This patch [4] fixes the issue for both 2_1 and 2_0_0 branches, although the test case it contains
does not produce a segfault (only raises an ArgumentError) on affected revisions.

[1] 659fd08f
[2] c41f74cf
[3] bc0f1312
[4] 4b146b25


Files

ruby-2.1-rb-str-associated.patch (2.5 KB) ruby-2.1-rb-str-associated.patch bkutil (Balazs Kutil), 12/17/2014 04:26 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0