diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-30 13:54:20 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-30 13:54:20 +0000 |
commit | 4becae174a3301eac5955f7900d3eef66728e440 (patch) | |
tree | 556f52823f113050a8952717fb32e79a2022e589 /plugins | |
parent | 57cf2138522f3dacf26ea30c6f32a800def70209 (diff) | |
download | rsyslog-4becae174a3301eac5955f7900d3eef66728e440.tar.gz rsyslog-4becae174a3301eac5955f7900d3eef66728e440.tar.bz2 rsyslog-4becae174a3301eac5955f7900d3eef66728e440.zip |
- fixed a bug that could cause invalid string handling via strerror_r
varmojfekoj provided the patch - many thanks!
- adopted varmojfekoj's patch to v3, some more sterror_r's ;)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/imudp/imudp.c | 3 | ||||
-rw-r--r-- | plugins/imuxsock/imuxsock.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c index d68e3772..fa9db53a 100644 --- a/plugins/imudp/imudp.c +++ b/plugins/imudp/imudp.c @@ -37,6 +37,7 @@ #include "net.h" #include "cfsysline.h" #include "module-template.h" +#include "srUtils.h" MODULE_TYPE_INPUT @@ -200,7 +201,7 @@ CODESTARTrunInput } } else if (l < 0 && errno != EINTR && errno != EAGAIN) { char errStr[1024]; - strerror_r(errno, errStr, sizeof(errStr)); + rs_strerror_r(errno, errStr, sizeof(errStr)); dbgprintf("INET socket error: %d = %s.\n", errno, errStr); logerror("recvfrom inet"); /* should be harmless */ diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c index 530bb2d4..54bbe039 100644 --- a/plugins/imuxsock/imuxsock.c +++ b/plugins/imuxsock/imuxsock.c @@ -38,6 +38,7 @@ #include "syslogd.h" #include "cfsysline.h" #include "module-template.h" +#include "srUtils.h" MODULE_TYPE_INPUT @@ -169,7 +170,7 @@ static rsRetVal readSocket(int fd, int bParseHost) printchopped(LocalHostName, line, iRcvd, fd, bParseHost); } else if (iRcvd < 0 && errno != EINTR) { char errStr[1024]; - strerror_r(errno, errStr, sizeof(errStr)); + rs_strerror_r(errno, errStr, sizeof(errStr)); dbgprintf("UNIX socket error: %d = %s.\n", errno, errStr); logerror("recvfrom UNIX"); } |