diff options
author | 2016-04-08 16:07:22 -0800 | |
---|---|---|
committer | 2016-04-08 17:11:28 -0700 | |
commit | 95ae233e25f8521b8b4cc3d02e424501f77b514b (patch) | |
tree | 1cf1d3bef2a349263d1fca0eb2e6fd7bed331e60 /tensorflow/python/training/server_lib_test.py | |
parent | 264bac93b1c8cc367d7519b13a6e1d11177c0227 (diff) |
Fix segfault in grpc_server_lib when an invalid hostname-port pair is passed.
Previously, if the port was undefined, an out-of-bounds access would
be made. This change adds the appropriate checks.
Change: 119424297
Diffstat (limited to 'tensorflow/python/training/server_lib_test.py')
-rw-r--r-- | tensorflow/python/training/server_lib_test.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tensorflow/python/training/server_lib_test.py b/tensorflow/python/training/server_lib_test.py index 3b9614472f..c07f5220dc 100644 --- a/tensorflow/python/training/server_lib_test.py +++ b/tensorflow/python/training/server_lib_test.py @@ -79,6 +79,12 @@ class GrpcServerTest(tf.test.TestCase): self.assertEqual(0.5, min_val) self.assertEqual(0.5, max_val) + def testInvalidHostname(self): + with self.assertRaisesRegexp(tf.errors.InvalidArgumentError, "port"): + _ = tf.train.Server({"local": ["localhost"]}, + job_name="local", + task_index=0) + class ServerDefTest(tf.test.TestCase): |