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>
This commit is contained in:
Jouni Malinen 2018-09-13 01:04:40 +03:00
parent 25f3c270d9
commit 1d73531fdb

View 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;