]> git.ozlabs.org Git - ppp.git/commitdiff
plugins/radius: fix segfault during shutdown. (#455)
authorJaco Kroon <jaco@uls.co.za>
Thu, 26 Oct 2023 09:52:27 +0000 (11:52 +0200)
committerGitHub <noreply@github.com>
Thu, 26 Oct 2023 09:52:27 +0000 (20:52 +1100)
ppp_get_ifname() is the wrong thing to use in this slprintf call as
it returns an int which is the length of the interface name, not
a pointer to the interface name, which is what ppp_ifname()
returns.

Closes: #454
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
pppd/plugins/radius/radattr.c

index 8db94daaae6f19afbf3b51d0dec71900725f7510..802cb66c370abb5d43e48c298e65db072a867d51 100644 (file)
@@ -114,7 +114,7 @@ cleanup(void *opaque, int arg)
 {
     char fname[512];
 
-    slprintf(fname, sizeof(fname), "/var/run/radattr.%s", ppp_get_ifname(NULL,0));
+    slprintf(fname, sizeof(fname), "/var/run/radattr.%s", ppp_ifname());
     (void) remove(fname);
     dbglog("RADATTR plugin removed file %s.", fname);
 }