libwww3.0 really isn't thread-safe...
Subject: libwww3.0 really isn't thread-safe...
From: Erik Selberg <firstname.lastname@example.org>
Date: Fri, 23 Jun 1995 16:02:24 PDT
From email@example.com Fri Jun 23 19: 02:26 1995
found this one today.
HTTCP.c and HTNews.c both use gethostbyname --- a seemingly innocuous
call, which returns a pointer to a static struct hostent.
wait, did someone say STATIC?
yup, that's right --- it ain't reentrant (at least on Alphas using
POSIX threads!). The fix? Easy enough --- use gethostbyname_r (the
re-entrant version) and #define _REENTRANT (or #define _THREAD_SAFE).
I'll post patches if someone likes.