Project

General

Profile

Actions

Bug #3489

closed

avoid NULL dereference upon failed realloc

Added by meyering (Jim Meyering) about 14 years ago. Updated about 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.3dev (2010-06-27 trunk 28450) [x86_64-linux]
Backport:

Description

=begin
There are two uses of realloc in thread.c, neither of which handles
the case in which realloc returns NULL.

Since these functions return void, the only solution appears to be to use xrealloc.
That appears to be consistent, since the similar function, rb_fd_set, in the same
file already uses xrealloc. I've attached the patch.

Sun Jun 27 22:58:36 2010 Jim Meyering

avoid NULL dereference upon failed realloc
* thread.c (rb_fd_resize): Use xrealloc, not realloc.
* thread.c (rb_fd_copy): Likewise.

=end


Files

thread-NULL-deref.patch (1.06 KB) thread-NULL-deref.patch patch meyering (Jim Meyering), 06/27/2010 11:14 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0