Re: Overflow with Big Acct-Output-Octets values

Sergey Poznyakoff <[email protected]> Tue, 24 Sep 2002 22:29:51 +0300
Newsgroups gmane.comp.gnu.radius.bugs
Organization Farlep-Internet
Message-ID <[email protected]>
Hello Philipp,

Thanks for noticing the problem. The following patch should fix it:

Index: radiusd/radutil.c
--- orig/gnu-radius-0.96.4/radiusd/radutil.c    Tue Sep 24 22:26:25 2002
+++ gnu-radius-0.96.4/radiusd/radutil.c Tue Sep 24 22:27:06 2002
@@ -175,7 +175,7 @@ attr_to_str(obp, req, pairlist, attr, de
                }
                break;
        case TYPE_INTEGER:
-               snprintf(tmp, sizeof(tmp), "%ld", pair->lvalue);
+               snprintf(tmp, sizeof(tmp), "%lu", pair->lvalue);
                len = strlen(tmp);
                obstack_grow(obp, tmp, len);
                break;

Regards,
Sergey