aboutsummaryrefslogtreecommitdiff
path: root/examples/example_1_echoClient/example_1_echoClient.cpp
diff options
context:
space:
mode:
author0xd34df00d <0xd34df00d@gmail.com>2019-10-12 18:42:32 -0400
committerLNJ <lnj@kaidan.im>2019-10-14 22:09:40 +0200
commitdaa03c8e12666e7ec47da7ef38770642282b3c75 (patch)
treeaba51026ee9ea71d9ef4e6d9da85a4da44b761d8 /examples/example_1_echoClient/example_1_echoClient.cpp
parente52030614d935dfb044b0e3fc57a30d812d626f3 (diff)
Fix potential SEGFAULT on connection error
`socketError()` calls `connectToNextDNSHost()` which might cause `socketError()` synchronously (and recursively), thus not giving a change for updating `nextSrvRecordIdx`. Overall, this results in attempting to connect to the same DNS record recursively, until the stack is exhausted, resulting in SEGFAULT. One of the solutions (done in this commit) is to increment the record index _before_ attempting to connect.
Diffstat (limited to 'examples/example_1_echoClient/example_1_echoClient.cpp')
0 files changed, 0 insertions, 0 deletions