]> git.sur5r.net Git - openocd/commit
server: add safeguards against printing bogus port number
authorPaul Fertser <fercerpav@gmail.com>
Wed, 17 Jan 2018 14:31:58 +0000 (17:31 +0300)
committerTomas Vanek <vanekt@fbl.cz>
Thu, 25 Jan 2018 07:22:16 +0000 (07:22 +0000)
commitf02327d85953152743dbb02d9ceeaa5b59da9ebe
tree1341a9c29fc3dea4c5e2abadec4567a5bd2fda41
parentff623b83fc74d40adcdfb36454393cf307d70f08
server: add safeguards against printing bogus port number

Clang static checker emits "Assigned value is garbage or undefined"
warning there as it can't prove that when the socket descriptor is
AF_INET/SOCK_STREAM and getsockname doesn't return an error, sin_port
is guaranteed to be filled in.

Pacify it by obvious means.

Change-Id: I43b5e5ceb41c07d523a81b34a25490c4c5f49a70
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/4350
Tested-by: jenkins
Reviewed-by: Tim Newsome <tim@sifive.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/server/server.c