]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Allow data2vp_any() to be called with packet==NULL
authorAlan T. DeKok <aland@freeradius.org>
Mon, 6 Feb 2012 09:53:52 +0000 (10:53 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 6 Feb 2012 09:53:52 +0000 (10:53 +0100)
The packet is only used to decrypt certain attributes.
If there is no need to decrypt those attributes, then the
packet pointer isn't necessary.

src/lib/radius.c

index 29890bd50234900c698cfd564a4fd799fdc917d7..8bcca4f39489af84fcd95ec8832ddf08c03e848b 100644 (file)
@@ -2919,7 +2919,7 @@ static ssize_t data2vp_any(const RADIUS_PACKET *packet,
        /*
         *      Decrypt the attribute.
         */
-       if (secret) switch (vp->flags.encrypt) {
+       if (secret && packet) switch (vp->flags.encrypt) {
                /*
                 *  User-Password
                 */