aboutsummaryrefslogtreecommitdiffstats
path: root/hs20
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2018-09-12 22:04:40 (GMT)
committerJouni Malinen <jouni@codeaurora.org>2018-09-12 22:04:40 (GMT)
commit1d73531fdbb5b231c18542f4a9e70abde4fb9b18 (patch)
tree23e52be993791a9952668660fa914e256b40c287 /hs20
parent25f3c270d91fbddaa3e43b277cbdd28a1e9b4792 (diff)
downloadhostap-1d73531fdbb5b231c18542f4a9e70abde4fb9b18.zip
hostap-1d73531fdbb5b231c18542f4a9e70abde4fb9b18.tar.gz
hostap-1d73531fdbb5b231c18542f4a9e70abde4fb9b18.tar.bz2
HS 2.0: Fix T&C server database check
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>
Diffstat (limited to 'hs20')
-rw-r--r--hs20/server/www/terms.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/hs20/server/www/terms.php b/hs20/server/www/terms.php
index e360be5..e269b3c 100644
--- a/hs20/server/www/terms.php
+++ b/hs20/server/www/terms.php
@@ -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;