]> granicus.if.org Git - php/commit
Fixed bug #75097 (gethostname fails if your host name is 64 chars long)
authorAndrea Faulds <ajf@ajf.me>
Sat, 19 Aug 2017 19:31:54 +0000 (20:31 +0100)
committerAndrea Faulds <ajf@ajf.me>
Sat, 19 Aug 2017 19:31:54 +0000 (20:31 +0100)
commit61538ebadc2ac80b29d6b7a9c355615fe0f40492
tree1304ae227443cf6eb1ca87a513971f43c1d9e94a
parent3cad07b84fdf8a1ae87cae1a92da12f6f556bdd1
Fixed bug #75097 (gethostname fails if your host name is 64 chars long)

PHP contained two different off-by-one errors, which are fixed here. First,
it created a buffer of size HOST_NAME_MAX, not adding space for a null
terminator. Second, it subtracted 1 from the size of that buffer when passing
its size to gethostname(), despite gethostname() expecting it to be a buffer
size including space for a terminating null byte, not a string length.
NEWS
ext/standard/dns.c