• Lance Chen's avatar
    Fix `serverURIs` iterating in MQTTAsync.c · 42f5c135
    Lance Chen authored
    This commit fixes two bugs related to `serverURIs` iterating in MQTTAsync.c
    
    1. Segfault occurs when there is no healthy connection in `serverURIs`
    
       Two off-by-one errors of the `currentURI` cause the issue. The first
       one happens when doing boundary check of `serverURIs`, and the other
       one happens when accessing `serverURIs` without checking the boundary
       first.
    
    2. The first URI in `serverURIs` gets skipped when restricting
       `MQTTVersion` to a particular value
    
       `currentURI` gets increased *before* connection attempts in each
       iteration.
    Signed-off-by: 's avatarLance Chen <cyen0312@gmail.com>
    42f5c135
Name
Last commit
Last update
..
python Loading commit data...
ssl Loading commit data...
tls-testing Loading commit data...
CMakeLists.txt Loading commit data...
MQTTTest_v2.c Loading commit data...
MQTTV311.py Loading commit data...
MQTTV3112.py Loading commit data...
dll-copy.cmake Loading commit data...
mqttsas.py Loading commit data...
mqttsas2.py Loading commit data...
sync_client_test.c Loading commit data...
test1.c Loading commit data...
test2.c Loading commit data...
test3.c Loading commit data...
test4.c Loading commit data...
test5.c Loading commit data...
test6.c Loading commit data...
test8.c Loading commit data...
test9.c Loading commit data...
test_mqtt4async.c Loading commit data...
test_mqtt4sync.c Loading commit data...