From e8bdad7f8b4da71657f504950adab65e352d864c Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 17 Sep 2007 16:49:14 +0000 Subject: - possibly found a bug in cvthname() that lead to a wrong size being specified in a getnameinfo() API call - not sure, though, if it is "the" bug (actually, it looks like it isn't). - this is EXPERIMENTAL - fixed a bug that caused signal handlers in cvthname() not to be restored when a malicious pointer record was detected and processing of the message been stopped for that reason (this should be really rare and can not be related to the segfault bug we are hunting). --- net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'net.c') diff --git a/net.c b/net.c index cc980f8f..20af3330 100644 --- a/net.c +++ b/net.c @@ -134,7 +134,8 @@ int cvthname(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN) sigaddset(&nmask, SIGHUP); pthread_sigmask(SIG_BLOCK, &nmask, &omask); - error = getnameinfo((struct sockaddr *)f, sizeof(*f), + //error = getnameinfo((struct sockaddr *)f, sizeof(*f), + error = getnameinfo((struct sockaddr *)f, SALEN((struct sockaddr *) f), (char*)pszHostFQDN, NI_MAXHOST, NULL, 0, NI_NAMEREQD); if (error == 0) { @@ -164,6 +165,7 @@ int cvthname(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN) "IP = \"%s\" HOST = \"%s\"", ip, pszHostFQDN); logerror((char*)szErrMsg); + pthread_sigmask(SIG_SETMASK, &omask, NULL); return 0; } -- cgit