1 2 Previous Next 21 Replies Latest reply on Apr 5, 2018 5:39 AM by axel.lin_1746341

    sdk-6.0.1: The buggy ota_server implementation

    axel.lin_1746341

      The implementation in ota_server_thread_main() for receiving packet data is buggy:

       

      wiced_packet_get_data(temp_packet, 0, (uint8_t**)&request_string, &request_length, &available_data_length);

      if ( request_length != available_data_length )

      {                      

        result = WICED_ERROR;    

        wiced_packet_delete(temp_packet);

        goto disconnect;         

      }                      

       

      1. It does not check the return value of wiced_packet_get_data() call

      2. The way to handle request_length != available_data_length is wrong.

         request_length != available_data_length does not means error but current code just delete the packet and disconnect the connection which is *wrong*.

      So I'm not surprised that users will randomly hit disconnect error when upload data to the ota_server.

        1 2 Previous Next