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