[zeromq-dev] zsys_hostname() crash and fix

McMillan, Scott A scott.a.mcmillan at intel.com
Wed Mar 4 22:31:05 CET 2015


Hi,

I ran into an error similar to the one reported at
https://github.com/zeromq/czmq/issues/907.

I think the fix in master is insufficient.  The problem is that host is
NULL, so referencing host->h_name still results in a segfault.

I suggest changing line 971 of src/zsys.c from

return host->h_name? strdup (host->h_name): NULL;


to

return host && host->h_name? strdup (host->h_name): NULL;


Thanks,
Scott

P.S. Sorry, I don't have a GitHub account so I can't send a pull request.
Hopefully this fix is small enough that this won't be necessary.

P.P.S. Any idea when czmq 3.0.0-rc2 will be made available?




More information about the zeromq-dev mailing list