cl->shortname may now be NULL
authoraland <aland>
Sat, 23 Apr 2005 00:50:55 +0000 (00:50 +0000)
committeraland <aland>
Sat, 23 Apr 2005 00:50:55 +0000 (00:50 +0000)
src/modules/rlm_radutmp/rlm_radutmp.c
src/modules/rlm_radutmp/rlm_radutmp2.c

index b990947..f017b58 100644 (file)
@@ -339,7 +339,7 @@ static int radutmp_accounting(void *instance, REQUEST *request)
                 */
                cl = client_find(&request->packet->src_ipaddr);
                if (!cl) rad_assert(0 == 1); /* WTF? */
-               if (cl->shortname[0]) {
+               if (cl->shortname && cl->shortname[0]) {
                        nas = cl->shortname;
                } else {
                        nas = cl->longname;
index 72f8a56..b2eb592 100644 (file)
@@ -871,7 +871,7 @@ static int radutmp_accounting(void *instance, REQUEST *request)
                 */
                cl = client_find(nas_address);
                if (cl) {
-                       if (cl->shortname[0]) {
+                       if (cl->shortname && cl->shortname[0]) {
                                nas = cl->shortname;
                        } else {
                                nas = cl->longname;