Hi,

This patch fixes it for me:

--- rstat_main.c.orig   2006-08-17 16:40:06.000000000 -0700
+++ rstat_main.c        2006-08-17 16:38:33.000000000 -0700
@@ -83,8 +83,8 @@
 int main(int argc, char **argv)
 {
        SVCXPRT *transp;
-        int fromlen, sock = 0, proto = 0;
        struct sockaddr_in from;
+        int fromlen = sizeof from, sock = 0, proto = 0;
        int count = 1;
 
        if (argc > 1) {

I didn't grok what the program is doing, only that the manpage for
getsockname() says:

"The namelen parameter should be initialized to indicate the amount of
space pointed to by name."

Doing so fixed rstatd-4.0.1 compiled with gcc 4.1.2 on a current i386
Etch box.

HTH,

--Pete

----------------------------------
Pete Harlan
ArtSelect, Inc.
[EMAIL PROTECTED]
http://www.artselect.com
ArtSelect is a subsidiary of a21, Inc.
--- rstat_main.c.orig   2006-08-17 16:40:06.000000000 -0700
+++ rstat_main.c        2006-08-17 16:38:33.000000000 -0700
@@ -83,8 +83,8 @@
 int main(int argc, char **argv)
 {
        SVCXPRT *transp;
-        int fromlen, sock = 0, proto = 0;
        struct sockaddr_in from;
+        int fromlen = sizeof from, sock = 0, proto = 0;
        int count = 1;
 
        if (argc > 1) {

Reply via email to