In this paper, an online adaptation algorithm for bipedal walking on uneven surfaces with height uncertainty is proposed. In order to generate walking patterns on flat terrains, the trajectories in the task space are planned to satisfy the dynamic balance and slippage avoidance constraints, and also to guarantee smooth landing of the swing foot. To ensure smooth landing of the swing foot on surfaces with height uncertainty, the preplanned trajectories in the task space should be adapted.The proposed adaptation algorithm consists of two stages. In the first stage, once the swing foot reaches its maximum height, the supervisory control is initiated until the touch is detected. After the detection, the trajectories in the task space are modified to guarantee smooth landing. In the second stage, this modification is preserved during the Double Support Phase (DSP), and released in the next Single Support Phase (SSP). Effectiveness of the proposed online adaptation algorithm is experimentally verified through realization of the walking patterns on the SURENA III humanoid robot, designed and fabricated at CAST. The walking is tested on a surface with various flat obstacles, where the swing foot is prone to either land on the ground soon or late.