• 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
.settings Loading commit data...
Windows Build Loading commit data...
cmake Loading commit data...
debian Loading commit data...
dist Loading commit data...
doc Loading commit data...
src Loading commit data...
test Loading commit data...
.cproject Loading commit data...
.gitignore Loading commit data...
.gitreview Loading commit data...
.project Loading commit data...
.pydevproject Loading commit data...
.travis.yml Loading commit data...
CMakeLists.txt Loading commit data...
CONTRIBUTING.md Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
about.html Loading commit data...
appveyor.yml Loading commit data...
build.xml Loading commit data...
cbuild.bat Loading commit data...
edl-v10 Loading commit data...
epl-v10 Loading commit data...
notice.html Loading commit data...
travis-build.sh Loading commit data...
travis-env-vars Loading commit data...
travis-install.sh Loading commit data...