diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-09-17 16:49:14 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-09-17 16:49:14 +0000 |
commit | e8bdad7f8b4da71657f504950adab65e352d864c (patch) | |
tree | fafcfd25f18d02d6e223f51531445cdef28ada68 /net.c | |
parent | d3a88c693c9d4ce0f5d0964d6aac169fd14afb67 (diff) | |
download | rsyslog-e8bdad7f8b4da71657f504950adab65e352d864c.tar.gz rsyslog-e8bdad7f8b4da71657f504950adab65e352d864c.tar.xz rsyslog-e8bdad7f8b4da71657f504950adab65e352d864c.zip |
- 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).
Diffstat (limited to 'net.c')
-rw-r--r-- | net.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; } |