]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
HS 2.0: Fix T&C server database check
authorJouni Malinen <jouni@codeaurora.org>
Wed, 12 Sep 2018 22:04:40 +0000 (01:04 +0300)
committerJouni Malinen <jouni@codeaurora.org>
Wed, 12 Sep 2018 22:04:40 +0000 (01:04 +0300)
It was possible for the wait loop to exit early due to the $row[0] == 1
check returning false if the database value was not yet set. Fix this by
updated the $waiting default value only if the database actually has a
value for this field.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
hs20/server/www/terms.php

index e360be5f4528c94d864a764571fbcd57e1349bd1..e269b3cd3bcf5bf208eb04f0575f62a5bfab2eb1 100644 (file)
@@ -59,8 +59,10 @@ if (!$accept) {
       if (!$row) {
          die("No current session for the specified MAC address");
       }
-      $waiting = $row[0] == 1;
-      $ack = $row[1] == 1;
+      if (strlen($row[0]) > 0)
+            $waiting = $row[0] == 1;
+      if (strlen($row[1]) > 0)
+            $ack = $row[1] == 1;
       $res->closeCursor();
       if (!$waiting)
          break;