Project

General

Profile

Bug #11877 ยป hostname_size.patch

nsheridan (Niall Sheridan), 12/26/2015 02:02 PM

View differences:

ext/socket/socket.c (working copy)
char buf[RUBY_MAX_HOST_NAME_LEN+1];
if (gethostname(buf, (int)sizeof buf - 1) < 0)
if (gethostname(buf, (int)sizeof buf) < 0)
rb_sys_fail("gethostname(3)");
buf[sizeof buf - 1] = '\0';
    (1-1/1)